Skip to main content
A market maker on Kalshi using Black-Scholes binary pricing on a short-dated BTC contract.

Full Code

How It Works

  1. 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
  1. Quoter places a fixed 4-cent spread around the fair value with size 10
  2. 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,000fairvalue0.25(unlikelytohit99,000 → fair value ≈ 0.25 (unlikely to hit 100k 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.