An automated weather prediction market trading bot. It watches 6 supercomputers, evaluates hundreds of contracts, and places bets when the math says we have an edge.
Kalshi is a prediction market where you bet on real-world events. One of the most popular categories is weather.
"Will the high temperature in Chicago be above 72°F tomorrow?"
Buy YES for 80¢. If it happens, you get $1.00 back — 20¢ profit.
If it doesn't happen, you lose your 80¢.
There are also bracket bets — narrow 2-degree ranges like "Will the high be 72–73°F?" These are harder to hit, which is why the bot treats them differently.
Most people on Kalshi check their phone weather app and guess. We ask six different supercomputers to each run dozens of simulations — giving us 225 independent forecasts.
When 200 out of 225 simulations agree on something, and the Kalshi market price doesn't reflect that confidence, we have an edge. The market is wrong, and we know it.
The bot pulls data from Open-Meteo's ensemble API. Each model runs the same physics simulation dozens of times with slightly different starting conditions. This gives us a probability distribution — not just a single number.
Weights aren't equal — the European model (ECMWF) gets the most trust because it has the best track record. AI-enhanced versions of both ECMWF and GFS are also included. If a model returns no data, its weight gets redistributed to the others.
Question: "Will Chicago's high be above 72°F?"
The bot counts how many simulations from each model predict above 72, then blends them using the weights.
| Model | Above 72°F | of Total | Model Prob | × Weight |
|---|---|---|---|---|
| ECMWF | 48 | 51 | 94% | 23.5% |
| ECMWF AI | 47 | 51 | 92% | 18.4% |
| GFS | 27 | 31 | 87% | 13.1% |
| GFS AI | 28 | 31 | 90% | 13.5% |
| ICON | 35 | 40 | 88% | 8.8% |
| GEM | 18 | 21 | 86% | 12.9% |
| Blended probability | 90.2% | |||
The daemon runs 24/7 on Cheesegrater. It only bets during two windows, then sleeps until the next one.
| Window | Local Time | Betting On |
|---|---|---|
| Morning | 6:00 AM – 9:00 AM | Today's weather |
| Evening | 6:00 PM – 11:00 PM | Tomorrow's weather |
Each city's windows use its own timezone. Outside these hours, the bot sleeps.
During each window, the bot runs this loop every 5 minutes:
It also sends a heartbeat when a window opens, runs a daily Claude AI advisor briefing, checks for unfilled orders, and deploys a dashboard update to Cloudflare Pages after each trade.
Seven US cities, tiered by a 171-day backtest. Coastal cities are more predictable and profitable. Tier 2 cities only bet on highs because their overnight lows are harder to forecast.
Every available contract runs through these 9 checks. All 9 must pass or the bot skips it. This is the heart of the engine — rules.js.
Can we decode the ticker? KXHIGHCHI-26MAR20-T72 = Chicago HIGH above 72°F on March 20. If it's garbled, skip.
Count across all 225 ensemble members. How many predict above/below the threshold? Blend using model weights. Output: a single probability like 89%.
Are the 225 guesses clustered together or all over the place? If the standard deviation is above 3°F, the bot says "the models disagree too much" and skips. This check is currently blocking everything.
Bracket bets are 2° ranges ("Will the high be 72–73°F?"). Only allow NO bets on brackets. If there's a >30% chance the bracket hits, skip entirely — not confident enough.
Check Kalshi's orderbook. What's the cheapest YES? What's the cheapest NO? Compute depth (how many contracts are available at that price). No orders = skip.
Compare our probability vs. the market implied probability. If we think it's 89% and the contract costs 80¢ (implying 80%), we might have edge. Accounts for 7% Kalshi taker fee. Need ≥10% edge.
After picking YES or NO, verify our chosen side has at least 70% win probability. No coin flips. We only bet when we expect to win.
Contract must cost between 30¢ and 75¢. Below 30¢ = longshot that rarely hits. Above 75¢ = too expensive for the profit.
Are there at least 5 contracts available at the price we want? No point finding a great deal if we can barely buy any.
Even when the checklist says "bet," hard limits in trading.js cap how much can be lost. These are hardcoded — the bot can't override them.