How KalshiArb works
1. Scan
Every five minutes we pull the full /markets?status=openfeed from Kalshi's public REST API at api.elections.kalshi.com/trade-api/v2, paginating through the cursor until we have every active contract. The data lives behind a Next.js unstable_cache tagged kalshi, so a single fetch serves the home page, the markets index, the ending-soon list, and the per-day pages.
2. Compute edge
Kalshi quotes prices in integer cents from 1 to 99. For every binary market we compute edge = (100 − yes_ask − no_ask) / 100. A positive edge is an intra-market arbitrage: buy both YES and NO at their best-asks, hold to settlement, lock the difference. We also rank by "tightest spread" (sum of asks closest to $1.00) so you can see which markets are about to flip into edge.
3. Surface
Every page on the site is a different cut of the same scanner output. The big numbers in the green bar at the top of every page come from /api/edge, which counts the number of markets currently sitting under $1.00 and the top edge percentage. The Bot tier ($39/mo) pipes the same signals into a private Telegram channel and a private Discord channel so you don't have to refresh the dashboard.
4. Execute (optional)
On the Autonomous AI Agent tier, you give us a Kalshi API key (sealed against a per-customer KMS key — never logged in plaintext). The agent picks the bankroll-appropriate size and fires both YES + NO legs as a single batched submission the moment a qualifying signal appears. If one leg partially fills, the agent cancels the other immediately and logs the slippage in your weekly audit report.
5. Geo-fence
Kalshi's sports event contracts are restricted in some U.S. states. The Autonomous Agent enforces those restrictions on every order — if your IP, account residence, or market eligibility check fails, the order is refused and logged. You stay on the right side of CFTC + state rules.
That's the whole loop. Pricing · AI Agent · Live ending-soon markets.