Long Earth SocietyLong Earth Society

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

P(YES)=ΦS − Kσ · m · √T
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
50%60%70%80%90%100%604530150MINUTES LEFT IN THE HOUR0.25σ0.5σ1σ1.5σ→ certain
The same distance from the strike means more as the clock runs down. A coin half a standard deviation above its strike with 60 minutes left is a 69% favorite; with 5 minutes left it is a 96% favorite.
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%.

60%70%80%90%100%60¢65¢70¢75¢80¢85¢90¢95¢ENTRY PRICEPAPERLIVE BREAKEVENEntry 65–70¢: 65.0% won (n=20)Entry 70–75¢: 78.6% won (n=28)Entry 75–80¢: 94.8% won (n=134)Entry 80–85¢: 86.0% won (n=43)Entry 85–90¢: 100.0% won (n=12)
Win rate needed to break even (lines) against what the bot actually won (dots, sized by number of trades), for the bot's filtered signals. The 75–80¢ bucket, where most trades landed, cleared both lines with room to spare. The rest sat close to the live line, where a few cents of slippage decide the month.

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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

50%60%70%80%90%100%Early: 79.0% won (n=81)79%Earlyn=81Middle: 92.0% won (n=101)92%Middlen=101Late: 89.7% won (n=127)90%Laten=12790% LIVE BAR
Win rate by part of the hour the trade was entered, filtered signals. Early trades barely paid on paper and lost money live; the hour has to declare itself before the model's confidence is worth anything. The exact cutoff became one of the bot's rules.

2. The model was confident, and overconfident

70%80%90%100%70%75%80%85%90%95%100%WHAT THE MODEL CLAIMEDPERFECT CALIBRATIONClaimed 70–75%: won 70.8% (n=1040)Claimed 75–80%: won 70.5% (n=261)Claimed 80–85%: won 77.2% (n=162)Claimed 85–90%: won 75.3% (n=174)Claimed 90–95%: won 81.5% (n=130)Claimed 95–100%: won 91.1% (n=269)ACTUAL
Hourly markets, ETH excluded. Every bucket sits under the diagonal. When the model said 92%, the coin won 82% of the time. The fix was not to trust the number, only the ranking: the higher the claim, the better the result, so the bar was raised until reality cleared 90%.

3. Stacking the filters

Entry rule (hold to settlement)TradesWonNet / contract
Every signal202174.8%+2.5¢
+ a confidence floor and a price cap56183.4%+10.1¢
+ a higher floor, a tighter cap30987.7%+17.9¢
+ the timing window22890.8%+22.5¢
Strictest combination18193.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

DASHBOARD (PAPER)Dashboard (paper): +5.0¢ per contract (595 live trades)+5.0¢KALSHI STATEMENTKalshi statement: +0.8¢ per contract (595 live trades)+0.8¢AVERAGE PER CONTRACT · SAME 595 LIVE TRADES
The same 595 live trades, measured twice. The dashboard priced each fill at the quote it saw; the statement shows what actually cleared.

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.

50%60%70%80%90%100%Aug 3: 53.3% won (n=15)53%Aug 3n=15Aug 10: 83.9% won (n=31)84%Aug 10n=31Aug 17: 97.9% won (n=95)98%Aug 17n=95Aug 24: 95.5% won (n=67)96%Aug 24n=67Aug 31: 80.0% won (n=20)80%Aug 31n=2090% LIVE BAR
Weekly win rate, best configuration. Two weeks cleared 90%. The bar for running live was 90%, every week.

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.

See the scoreboard →

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.