A market maker on Kalshi using Black-Scholes binary pricing on a short-dated BTC contract.
Full Code
How It Works
- Fair value uses the Black-Scholes binary formula with:
- Strike: $100,000
- Volatility: 60% annualized
- Time to expiry: 1 day (short-dated)
- Underlying: BTC price from Binance WebSocket feed
-
Quoter places a fixed 4-cent spread around the fair value with size 10
-
Risk is capped at 50 contracts per market
Short-Dated vs Long-Dated
For a 1-day contract, the binary option is highly sensitive to the underlying price:
- BTC at 99,000→fairvalue≈0.25(unlikelytohit100k in 1 day)
- BTC at $100,000 → fair value ≈ 0.50 (coin flip)
- BTC at $101,000 → fair value ≈ 0.75 (likely already above)
For longer-dated contracts, increase tte:
Run It
Use Kalshi’s demo environment for testing: set api_url="https://demo-api.kalshi.co/trade-api/v2" or KALSHI_API_URL env var.