← All case studiesKalshi EDGE

Built a live AI trading platform for Kalshi’s crypto markets

Over 160,000 lines of Python: 15 real-time data feeds, an AI decision layer and a risk engine, with 1.8 million logged decisions and 5,254 live trades.

Kalshi EDGE dashboard: balance $712.86, session pool $200.00, fees paid $21.75, today’s P&L +$184.82 and a 100% win rate over 45 closed trades, above live BTC, ETH and SOL 15-minute market cards with price charts, strikes, confidence and bid/ask depth.
The Kalshi EDGE dashboard on May 4, 2026: the day’s results so far (45 closed trades, all wins, +$184.82), above real-time BTC, ETH and SOL 15-minute markets with spot price, strike, order-book depth and model confidence.

Role

System Architect, Software Developer & AI Engineer

The challenge

Kalshi lists crypto price contracts that settle every 15 minutes against CF Benchmarks’ Real-Time Index. Prices react to spot markets within seconds, but each contract’s value also depends on time to close, distance from the strike, thin order books and fees. Trading them well means combining many fast data sources, deciding in real time, and making sure no bug or stale feed puts real money at risk.

What I built

  • A modular trading platform in Python: over 160,000 lines of production code across 17 subsystems (data, features, regime detection, strategy, risk, execution, backtesting, monitoring, runtime and a web dashboard), with 2,324 automated tests.
  • 15 real-time market data feeds over WebSocket and REST connections: Kalshi order books and trades, Coinbase, Kraken (including order-by-order L3 data), Hyperliquid, on-chain activity, and CF Benchmarks’ Real-Time Index, the price these contracts settle against.
  • An AI decision layer: a supervisory “brain” built on the Hermes agent framework with Anthropic models, gated by confidence thresholds and rate limits, plus Kronos, an open-source foundation model for financial time series, as one of several probability signals.
  • A risk engine with absolute vetoes: fee-aware expected value on every decision, circuit breakers, a latency veto that halts trading when data feeds go stale, and continuous reconciliation against the exchange.
  • One engine for replay, paper and live trading, so strategies could be tested on live data before risking real money. Live mode requires explicit confirmation in the dashboard.
  • A FastAPI operations dashboard with 46 API endpoints, for monitoring and on-the-fly strategy changes that hot-reload into the running engine without a restart.
  • A PostgreSQL analytics store (19 GB) of market ticks, exchange trades, decisions and fills for backtesting and model training, designed for multiple users and bot instances.

By the numbers

  • 591 live trading sessions over about 427 hours between May and July 2026, alongside 888 paper and 47 replay sessions.
  • 5,254 live trades across 1,912 markets in five assets: BTC, ETH, SOL, XRP and HYPE.
  • 1.79 million decisions logged with their rationale: 1.66 million market scans produced 125,770 trade candidates, and the risk engine’s vetoes blocked 93% of them.
  • 15.7 million market snapshots recorded over 92 days, plus 4.5 million historical Kalshi trades.
  • Sub-millisecond risk, order-handling and control steps inside the engine (medians of 0.001–0.22 ms).