Kalshi lets people buy and sell contracts on real-world events — things like 'will it rain tomorrow?' or 'who will win the election?' I built a bot that watches these markets in real time, decides what prices make sense, and places trades automatically.
The idea
Prediction markets are full of small, fast-moving opportunities. Prices jump around as news breaks and people change their minds. Watching hundreds of these markets manually is impossible. The idea was simple: build a program that watches the markets, figures out fair prices, and trades when it spots a gap.
How it works
The bot connects directly to Kalshi's live data feed. It collects prices, updates its own view of how likely each outcome is, and posts buy and sell orders around that fair price. When other traders fill those orders, the bot adjusts its position and keeps quoting. Everything is logged in a database so I can see exactly what it did and why.
Still learning in public 😅
What I learned
01
Risk control matters more than being right. The bot became more stable once I focused on how much it could lose on any single trade.
02
Speed isn't everything, but slowness is expensive. A small delay in canceling old orders turned into real losses.
03
Live trading reveals problems backtests miss. Paper trading for two weeks caught bugs that no historical test ever found.
04
Simple, reliable infrastructure beats clever code. Moving to a proper event queue removed a whole category of weird failures.