4 min read

Building a Stink Bid Bot with Kalshi API

In the last video, we covered how to explore Kalshi markets using public API endpoints, meaning no authentication was required.

Today we're going a step further. We're going to authenticate with the API and place orders on Kalshi programmatically. I'll show you a real trade I tried during the NFC Championship game, and why it didn't work out the way I expected.

This is a story about stink bids, order walls, and what happens when you're competing against traders with faster information than you.

By the end of this tutorial, you'll know how to:

  • Authenticate with the Kalshi API using RSA keys
  • Place and cancel limit orders programmatically
  • Read the orderbook to spot large orders
  • Understand why simple stink bids might not be enough

NFC Championship Game

So I ran this code during the NFC Championship game: Rams vs Seahawks. I was watching the Rams drive down the field in the second quarter.

Puka Nacua had zero touchdowns. The 2+ TD prop started the game around 12 cents YES, 88 cents NO. This bet was somewhat of a longshot, most players don't score twice in one game.

The thing about 2+ TD props is that they're usually overpriced. We know this because we looked at the historical dataset. The market implies about a 12% chance, but the actual hit rate is much lower. We think there's edge in betting NO on these longshots.

Now I noticed every time the Rams would drive up the field, there would be some people some people thinking "Nacua's about to score!". But he didn't score. And there were cases where I was able to scoop up NO contracts cheaper than they were before the game started, even though Nacua still had zero TDs and an entire quarter had passed.

So I had an idea: what if I placed low bids for NO during these time periods.

I placed stink bids at 78, 75, and 72 cents. If someone panicked and sold to me, and then the drive stalled or someone else scored, the price would revert back to 90+ cents. Easy profit.

Authentication

Alright, let's get into the code. To place orders, you need to authenticate with the Kalshi API.

This post is for subscribers only