Skip to content

Configuration

Arbiter-Bot requires credentials for both Polymarket and Kalshi exchanges.

Environment Variables

Set the following environment variables before running:

Polymarket

Variable Description Required
POLY_PRIVATE_KEY Ethereum private key for signing orders Yes
POLY_API_KEY CLOB API key Yes
POLY_API_SECRET CLOB API secret Yes
POLY_API_PASSPHRASE CLOB API passphrase Yes

Kalshi (Production)

Variable Description Required
KALSHI_KEY_ID API key identifier Yes
KALSHI_PRIVATE_KEY RSA private key (PEM format) Yes

Kalshi (Demo Environment)

For testing with Kalshi's demo environment (mock funds, no real money):

Variable Description Required
KALSHI_DEMO_KEY_ID Demo API key identifier For --kalshi-demo
KALSHI_DEMO_PRIVATE_KEY Demo RSA private key (PEM format) For --kalshi-demo

Use with the --kalshi-demo CLI flag. See Kalshi Demo Environment to create demo credentials.

Setting Environment Variables

The engine automatically loads .env files from: 1. arbiter-engine/.env (recommended location) 2. Project root .env

Create a .env file:

# Polymarket
POLY_PRIVATE_KEY=your_ethereum_private_key
POLY_API_KEY=your_clob_api_key
POLY_API_SECRET=your_clob_api_secret
POLY_API_PASSPHRASE=your_clob_passphrase

# Kalshi (Production)
KALSHI_KEY_ID=your_kalshi_key_id
KALSHI_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
...your key content...
-----END RSA PRIVATE KEY-----"

# Kalshi (Demo - for testing with --kalshi-demo flag)
KALSHI_DEMO_KEY_ID=your_demo_key_id
KALSHI_DEMO_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
...your demo key content...
-----END RSA PRIVATE KEY-----"

# Paper Trading Settings (optional, can also use CLI flags)
ARBITER_FIDELITY=realistic    # basic or realistic
ARBITER_LATENCY_MS=50         # simulated network latency in ms

CLI vs Environment Variables

CLI flags take precedence over environment variables. For example, --fidelity basic overrides ARBITER_FIDELITY=realistic.

Security

Never commit .env files or credentials to version control. Add .env to your .gitignore.

Using shell exports

export POLY_PRIVATE_KEY="your_key"
export KALSHI_KEY_ID="your_key_id"
# ... etc

Next Steps

After configuration, proceed to First Run to verify connectivity.