Skip to main content
A market maker on Polymarket using Black-Scholes binary pricing, spread-based toxicity estimation, and GLFT adverse selection spread with inventory skew.

Full Code

Pipeline Breakdown

Stage 1: Fair Value

Uses the Black-Scholes binary option formula to price a prediction market as a digital option:
  • S = current BTC price (from Binance feed)
  • K = strike price ($100k)
  • σ = implied volatility (0.6)
  • T = time to expiry (30/365 years)

Stage 2: Toxicity

Uses spread-based toxicity as a proxy for informed flow. A wider bid-ask spread on the underlying suggests more adverse selection:
  • Tight spread → low toxicity → tighter quotes
  • Wide spread → high toxicity → wider quotes

Stage 3: Quoter

The GLFT spread combines three components:
  • Base spread: minimum spread (2 cents)
  • Inventory penalty: widens spread as position grows
  • Toxicity adjustment: widens spread when flow is more informed

Run It