Kalshi market-making bot
Solo project · Nov 2025 – Present
A fully-automated market-making system I designed, built, and run on Kalshi's prediction markets.
What it does
The system quotes two-sided prices on Kalshi event contracts, posting both a price it will buy at and one it will sell at, and earns the gap between them (the bid–ask spread) while keeping inventory and risk inside tight bounds. It also picks its own markets: scanner tooling surfaces candidate markets worth quoting and feeds a config pipeline that regenerates and hot-deploys per-market parameters. The bot runs as a long-lived service, reacting to the order book in real time and carrying positions into contract settlement. I change operating parameters and acknowledge incident halts when needed.
How it's built
- Real-time ingestion. WebSocket order-book and fill feeds with per-market sequence-continuity checks. Any gap invalidates the local book and forces a fresh snapshot, so the bot never quotes off drifted state.
- Quoting engine. Quote eligibility and placement adapt to the live spread regime and to the depth of the external book, with the bot's own resting orders subtracted out first. Sizing responds to realized fill activity and time of day, quotes ladder across multiple price levels, and correlated markets are quoted in a coordinated way rather than independently.
- Risk management. Inventory is skewed back toward flat under per-market position caps, each event carries its own stop-loss, and detected risk events trigger cooldowns that pull quotes when flow looks informed.
- Order lifecycle. Place/amend/cancel machinery with debounced re-quoting and coalesced mutations to minimize time out of the market, exact-decimal price and quantity handling, and fill attribution through recorded order lineage rather than heuristics.
- Fail-safes. A lease-and-fencing scheme guarantees only one instance can ever write orders. Ambiguous state quarantines the affected market instead of the whole bot, genuine incidents halt trading until a human acknowledges, and on restart positions are rebuilt from exchange truth before quoting resumes.
- Operations. ~75K lines of Python (asyncio, one event loop) with 230+ test files, deployed as a fleet of monitored services with 15-minute health checks and canary rollouts for parameter changes.
Details about my market-selection criteria, signals, and parameter values are kept proprietary.
Results
Across two live accounts, the system has booked $65K+ in net P&L to date, over ~300,000 closed positions in ~18,000 distinct markets across ~900 series. The measured Jan–Jun 2026 window covers 287,920 of those positions, over which it recorded a 70.6% win rate, a 5.9 annualized Sharpe on daily dollar P&L, and a $473 maximum drawdown in cumulative P&L. The system has been live for more than six months.
The bot trades on live credentials, so the source isn't public. The chart and measured-window statistics come from my full closed-position exports; the net P&L figure is the to-date total.