< back

Building a prediction market trading engine

Prediction markets are a weirdly clean sandbox for trading. Every contract is a yes/no question that pays $1 or $0, so a price of 37¢ is just the crowd saying "37% likely". If you think you know the probability better than the crowd, you have a trade. That framing pulled me in, and it's been my main side project for most of 2026.

[2025-12]

v0: looking for free money

I started with a small backtester on Polymarket data and the most naive strategy possible: if the best YES ask plus the best NO ask is under $1, buy both and lock in the difference.

It never showed up. At the top of the book the market was efficient enough that this kind of arb basically didn't exist. Useful lesson early: there's no free money, so any edge has to come from actually modelling something better than the market does.

[2026-02 → now]

v1: an event-driven engine

I moved to Kalshi and rebuilt from scratch as three small services that talk through Redis:

 exchange websocket
         |
         v
 [ market data ] --> live order books in Redis
         |
   "book changed"
         v
 [ signals ] --> order requests
         |
         v
 [ order mgmt ] --> risk checks --> exchange

Today it tracks ~670 live markets with around 200ms average signal-processing latency, and I've benchmarked my models against market-implied probabilities on 1.3M historical trades.

Design rules that saved me

What I've learned so far

I'm keeping the actual strategies to myself for now, but happy to nerd out about the architecture. Reach out!