Misc · Field notes · Apr 2026 – now
Racing the clock.
Five months building an AI-written trading bot for Kalshi's hourly crypto markets. It won 94% of the time on paper. Live, it broke even. This is the formula, the data, and where the edge went.
See the live scoreboard → Read the story
- S
- spot price: the CF Benchmarks index Kalshi settles on
- K
- strike, read from the ticker
- σ
- realized volatility
- m
- per-coin calibration multiplier
- T
- time left until settlement
- Φ
- normal CDF: distance → probability
- Duration
- ~5 months
- Signals scored
- 11,572
- Best paper win rate
- 93.9%
- Live, per contract
- +0.8¢
The market
Every hour, Kalshi lists binary contracts on six coins: will BTC be above $78,900 at 4 pm ET? A YES pays $1.00 if it is, nothing if it isn't. The price, in cents, is the crowd's probability. A YES at 77¢ says the market thinks it's a 77% chance.
The idea was simple. If a model can price the contract better than the crowd in the minutes before settlement, buy whatever is cheap relative to fair value and hold it to the bell.
The formula
Treat the coin's price over the remaining time as a random walk. How far it can wander grows with the square root of time, so the useful number is the distance to the strike measured in "how far it can still move": z = (S − K) / (σ·m·√T). Push z through the normal curve and you get a probability. That probability, times 100, is fair value in cents.
The edge was fair − ask. Kalshi's books are slow and thin; when spot moved, the order book often hadn't. The bot bought when fair value said 90+ and the market was still asking 65–80.
The √T term is the whole story. Early in the hour, a coin can easily cross back. Late in the hour it mostly can't, and the model's confidence becomes earned.
The price is the probability
Here is the arithmetic that decides everything. Buy at 77¢ and hold: a win pays 23¢, a loss costs 77¢. To break even you have to win 77% of the time, plus Kalshi's fee, which is 7·P·(1−P) cents per contract per side. The entry price is the win rate you need.
Live trading adds more: the fill is a cent or two worse than the screen, some orders fill partially or not at all, and exits sell into thin bids. That came to roughly 3–4¢ per contract, which pushes the real breakeven at a 77¢ entry to about 82%, and on bad-fill days to 90%.
Five months, five bots
Thousands of trades across five versions. Each one died the same way: profitable in one crypto regime, not through the next, and never by enough to clear the fees and the spread. The formula was the last one standing.
- Apr
Lag arbitrage
Coinbase prices move first; Kalshi's books catch up 0.5 to 5 seconds later. A hazard model scored the lag at AUC 0.90. Profitable in one regime, not the next, and never by enough to clear the spread.
- May
15-minute momentum
Parallel workers per coin, an entry model at AUC 0.80, fixed take-profit and stop-loss in cents. Same ending: a regime change, and fees bigger than the edge.
- Jun
A pricing table, and a bug in the tape
3.25 million market snapshots bucketed by distance-to-strike and time left. Average calibration error: 19¢. Kalshi had quietly moved the tails to tenth-of-a-cent ticks, and the bot was rounding them away.
- Jul
The oscillator dashboard
A browser dashboard became the brain; a server on the East Coast became the hands. Best 15-minute configuration: about 78–80%, below the breakeven line once fees and spread were counted.
- Aug
Hourly markets, hold to settlement
The switch that worked on paper. Mid-month, Kalshi split its exchange into shards; the old key silently placed zero orders for three days.
- Sep
The verdict
Two straight weeks above 95% on paper. Then a choppy week, and live friction ate what was left. Parked at one contract.
What the data said
Every signal the dashboard produced, traded or not, was logged and later scored against Kalshi's official result for that market. 2,021 hourly signals survived cleanup (ETH and DOGE excluded; see below).
1. When you buy matters more than what the model says
2. The model was confident, and overconfident
3. Stacking the filters
| Entry rule (hold to settlement) | Trades | Won | Net / contract |
|---|---|---|---|
| Every signal | 2021 | 74.8% | +2.5¢ |
| + a confidence floor and a price cap | 561 | 83.4% | +10.1¢ |
| + a higher floor, a tighter cap | 309 | 87.7% | +17.9¢ |
| + the timing window | 228 | 90.8% | +22.5¢ |
| Strictest combination | 181 | 93.9% | +26.9¢ |
Hold to settlement, hourly markets Aug 8–Sep 2, scored against official results. Net is paper, after the exchange fee and before slippage.
4. Never sell at 95¢
The obvious move is to take profit when a contract reaches 95¢. Of 267 trades that touched 95¢, 95.5% settled as winners. Selling early gives up 5¢ on almost every trade to avoid a rare loss, and in thin books the "95¢" exit usually filled at 86–90. Holding was worth more.
5. Two coins that didn't fit
DOGE won 39% of its high-confidence signals. ETH's calibration broke outright (one day logged 160 garbage entries at fair 90+). Both were benched; the tables above exclude them.
Why it didn't work
Friction ate the edge. On paper, a well-filtered trade made 15–25¢. In practice the bot traded at many entry prices, and the average live trade made 5¢ on the dashboard and 0.8¢ on the statement. Slippage, partial fills and exits into thin bids took about 4¢ a contract, which is most of a thin edge.
The books were too thin to scale. Orders of 5–20 contracts regularly filled partially or not at all. Displayed bids were sometimes phantom depth that vanished on contact. A strategy that can't grow past a few contracts can't pay for its own development.
The edge depended on the weather. Trending hours were easy. In choppy hours, when spot ping-pongs across the strike, the model produced confident calls in both directions and won about half of them. Weekly results tell it: 53%, 84%, 98%, 96%, then 80% the week the market turned choppy.
The plumbing fought back. Kalshi's August exchange sharding meant the old API key silently placed nothing for three days. Sub-cent ticks near 0 and 100 were rounded away. Each fix was real, and each cost a week of data.
Built with AI
I'm not a professional quant or software engineer. Almost every line of this bot, in Python, plus a browser dashboard in JavaScript, was written with AI coding assistants. I described what I wanted, read what came back, ran it, and fed the errors and the trade logs back in. Five versions in five months is only possible that way.
AI is very good at the plumbing: signing Kalshi API requests, websocket feeds, order handling, logging every signal to a file, the dashboard, the backtests. It is not a source of edge. It will happily write a strategy that looks brilliant in a backtest and loses money live, because nothing in the code knows about the order book you're actually trading into. The edge, if there is one, comes from measuring honestly and refusing to believe the paper numbers.
Why most Kalshi bots on GitHub lose money
Before building this I searched for a Kalshi trading bot and found plenty of open-source ones. Almost none showed live results, and the ones that did weren't profitable. After five months I think I know why, and it isn't the code:
- They ignore the fee. Kalshi charges 7·P·(1−P) cents per contract per side, highest near 50¢. A strategy that wins 52% of coin-flip contracts loses money.
- They backtest at the quote. A simulation that fills at the displayed price is grading a different strategy. Live, fills were a cent or two worse, and exits sold into thin bids: about 4¢ a contract, most of a thin edge.
- They assume the size is there. Hourly crypto books are thin. Orders of 5–20 contracts often filled partially or not at all, and some displayed depth vanished on contact.
- They test one regime. Crypto flips between trending and choppy. A bot tuned in a trending week gives it back the next choppy one; every version of mine did.
- They trust the model's number. A model can rank outcomes well and still be overconfident. Mine said 92% when the truth was 82%. Score against Kalshi's official results, not your own screen.
If you're building one: log every signal, traded or not; score it against official settlement; subtract the fee and a realistic slippage before you believe anything; and run it at one contract until the live statement agrees with the dashboard.
Common questions
- Can a Kalshi trading bot be profitable?
- On paper, easily. Live, mine broke even: about +0.8¢ per contract after fees and slippage across 595 live trades. Small edges exist in the minutes before settlement, but thin books cap how much you can trade.
- Does Kalshi have an API for trading bots?
- Yes. Kalshi has a REST API and a websocket feed with live prices, order books and the CF Benchmarks crypto indices its markets settle on. You sign requests with an API key.
- Can AI write a trading bot?
- It can write a working one quickly; this one is proof. What it can't do is tell you whether the strategy makes money. Only honest live testing does that.
- Is this investment advice?
- No. It's a record of an experiment, including the parts that didn't work.
What I learned
- In a binary market, price is breakeven. Any edge has to clear the entry price plus every cent of friction, and friction is fixed while edge is not.
- Time is the best feature. The strongest single filter was when in the hour to trade, ahead of anything layered on top of the formula.
- Calibrate, then distrust. A probability model that ranks well can still lie about the number. Score it against official outcomes, not the screen.
- Paper hides the order book. A simulation that fills at the quote is grading a different strategy from the one that trades.
- Survive the regime change. Crypto switched between trending and choppy several times in six months. Every version that worked in one regime gave it back in the next; only a bar high enough to hold through both is worth trading.
- Liquidity is the ceiling. The edge existed. There just wasn't enough volume on the other side to make it worth anything.
Now on a public scoreboard
The bot is off, but the hourly model isn't. Since Oct 19, 2026 it runs in predict-only mode (it can't place orders) and every call is scored against Kalshi's own prices once the hour settles. If the model knows something the market doesn't, it'll show up there; if not, that'll show up too.
Data: every dashboard signal from Jul 19 to Sep 2, 2026, deduplicated and scored against Kalshi's official market results. Hourly-market figures exclude ETH and DOGE unless stated. Questions or ideas: Discord.