Building a Kalshi Trading Bot: Architecture, Authentication, and Honest Results
What actually goes into a working Kalshi trading bot: the market scanner, the authentication layer nobody enjoys writing, the position-sizing math that determines whether accuracy even matters, and what happened when we tested a real strategy against real markets.
Kalshi is a CFTC-regulated exchange for event contracts, including short-duration crypto price markets that settle every 15 minutes. Building a bot against it looks simple from the outside: pull a price, place a trade, collect a payout. In practice, three things trip up almost everyone who tries: the authentication scheme, the payout math, and the temptation to trust a backtest that doesn't survive contact with real spread and fees.
The market scanner
Kalshi's 15-minute crypto series (BTC, ETH, SOL, XRP) open on a rolling basis. A scanner has one job: find the markets that are still close to 50/50, and ignore the ones that have already been priced by everyone else. A market sitting at 1¢ or 99¢ YES has already decided; entering there is not a trade, it's a lottery ticket. The scanner needs to poll active markets, cache aggressively to avoid rate limits, and flag freshness before any signal logic even runs.
Authentication: the part nobody enjoys
Kalshi's live-trading API uses RSA request signing, not a simple bearer token. Every request needs a timestamp and method signed with a private key, formatted exactly right, or the API silently rejects it. This is the single most common place people give up on a first attempt. It's not conceptually hard, but it's fussy, and one wrong detail (key format, signing string order, clock skew) produces an opaque authentication failure with no useful error message.
Why position sizing matters more than accuracy
This is the part most people get wrong first. A 50% win rate sounds like break-even. It isn't, if your payouts are asymmetric. Consider a real result from early testing:
The arithmetic that changes everything
32 trades, 50% win rate, and the account was losing money steadily. Why: wins were paying $0.16, losses were costing $7–9. At that payout ratio, 50% accuracy isn't break-even, it's a losing strategy.
The fix: only trade when the market price is between 35¢ and 65¢, which roughly equalizes what a win pays against what a loss costs. That single filter turns "accuracy" into a meaningful number for the first time.
Paper trading against real markets, not backtests
A backtest replays historical candles. Paper trading, done right, simulates fills against live order books in real time, which is the only way to see real spread cost before risking capital. This matters because spread and Kalshi's taker fee are exactly the costs a backtest tends to under-model, and they're often the entire difference between a strategy that looks profitable on paper and one that actually is.
What we found, tested honestly
After building the full pipeline (scanner, momentum signal engine, the symmetric-odds filter above, and several hundred paper trades against real markets), the result was break-even to slightly negative after spread and fees. We also tested the exact inverse of the signal (if the read is wrong, betting against it should work). It also lost. When a signal and its mirror image both lose, the signal isn't there. That's a real, useful finding, and it's documented with the actual trade log, not a summary.
What's actually hard to build (and what isn't)
The trading signal itself is often a few hundred lines. The parts that take real time are the parts above: signed authentication that doesn't silently fail, a scanner that correctly identifies fresh markets, a sizing filter that makes accuracy meaningful, and a paper-trading harness honest enough to show you the truth before you risk anything. That infrastructure doesn't change based on which signal you're testing, which is exactly why it's worth building once, correctly, rather than rebuilding it for every strategy idea.
Skip the plumbing month
The Kalshi Crypto Bot Framework packages this exact architecture (scanner, signed execution, symmetric-odds risk filter, paper-trading default, and the full honest trade log from testing above), so you start at the strategy, not the authentication docs.
Join the list for launch →Frequently asked questions
Do I need a Kalshi account to test a bot?
No. Paper trading reads public market data and simulates fills. No account or API key required. You only need Kalshi credentials for live execution.
Why does a 50% win rate sometimes lose money?
Because win rate alone doesn't determine profitability. Payout size does. If wins pay less than losses cost, accuracy above 50% is required just to break even. Symmetric-odds position sizing (trading only near 50¢) is one way to make win rate a meaningful number again.
Is algorithmic trading on Kalshi legal?
Kalshi is a CFTC-regulated exchange, and its public API is designed for programmatic access. As with any trading activity, verify current rules for your jurisdiction and account type before trading with real funds.
What's the real cost that kills most momentum strategies here?
Spread and taker fees, consistently underestimated by backtests that replay historical candles instead of simulating fills against live order books.
Education and research content. Not financial advice. Trading involves substantial risk of loss.