Kalshi Market Mechanics

Recently I’ve been studying the prediction market Kalshi. Kalshi is a CFTC approved market for binary event contracts. This post is about how the internal mechanics of Kalshi markets work. This understanding is valuable for writing trading bots that access Kalshi using its REST API, or for prediction market enthusiasts who want to peak under the hood.

Event Contracts

What is an event contract? Let’s look at an example. The MOON-25 contract lets you bet on whether NASA will land a manned mission on the moon by 2025. Like in a futures market, you can open a position on either side of the contract: Yes or No. For instance, if you open a Yes position, you’re buying a contract that will pay out $1 if NASA does land on the moon by 2025, and $0 if they do not.

The Kalshi Web UI

The Kalshi website offers a rich UI that presents each Kalshi market as a typical two-sided market with a standard bids-and-asks order books for both the Yes and No contracts on the event. If you think NASA will land on the moon, you buy Yes at the current best ask price in the order book for Yes. As I’ll show in a moment, that’s not how Kalshi markets work internally. However, it’s a good simplification for people who are used to stock, crypto and other double-sided markets.

Kalshi Markets Under the Hood

This article is about how Kalshi markets work under the hood. You’ll want to understand this to write trading bots that use Kalshi’s API. (You can experiment with my own trading bot toolkit at github.com/fsctl/go-kalshi).

An event market on Kalshi does not have two contracts, Yes and No, that trade independently of one another. Instead, there is just a single contract for MOON-25, and you can either go “long” (buy the Yes side) or go “short” (buy the No side). In that sense, it’s more like a futures market than a stock market.

But futures markets require margin and collateral. Kalshi presumably doesn’t want to deal with extending credit to randoms on the Internet, so they need a market structure in which traders always fully collateralized no matter how prices move in the market. How do they achieve this? In short, you pay money to open a position (e.g., Yes), and then you pay money again to close the position by opening an offsetting position on the opposite side (e.g., No). The price you pay to open a Yes position is always 1-pno, and the price you pay to close a Yes position (i.e., open a No position) is always 1-pyes. Once you have closed your Yes position, you hold one Yes and one No contract, which by definition are worth $1 since Yes and No are mutually exclusive and cover all possible outcomes. So, the exchange credits you $1 per contract for each position you have closed out.

An example will make this much clearer. Right now the order book for MOON-25 looks like this:

Let’s say we want to open a position on the Yes side of the market. What do we have to pay? Opening a Yes position always costs 1-pno, which in this case is 1 minus the best (highest) No bid price in the book. That’s 1-80 cents = 20 cents. So, we can open a Yes position by paying 20 cents for one contract. Once we’ve done this, our total outlay thus far is $0.20 and we have an open Yes position in the amount of 1 contract.

To close the position, we need to open an offsetting No contract. Opening a No position is always done at price 1-pyes, the best (highest) Yes bid price. That’s 16 cents here, so the price to open our offsetting No position is 1-16 cents = 84 cents. After closing the position at this price, our total outlay is 20 cents (cost of opening Yes position) plus 84 cents (cost of opening the offsetting No position) equals $1.04. And since our net position is 1 Yes and 1 No, we are guaranteed a payment of $1. The exchange does this netting out instantly and immediately credits our account $1.

This example was not a very good trade: we paid $1.04 and got $1 back, for a loss of 4 cents. This loss is analogous to the bid-ask spread in a traditional double-sided market. In a real trade, we would presumably have waited for prices to move in our favor before closing the position. If we had closed the position later on after the bid price pyes had risen, 1-pyes would have been lower, and our total outlay would have been less than $1. Thus we would have paid less than $1 in order to receive $1, resulting in a gain.


The key insight here is that Yes and No are linked in multiple ways. You close a Yes position by opening an offsetting No position, and you close a No position by opening an offsetting Yes position. The price of opening a Yes position is always 1-pno and the price of opening a No position is always 1-pyes. Since closing a position is done by opening a position on the other side, you’re paying both to open a position and again to close it, at which point the exchange pays you $1.

Leave a Reply

Your email address will not be published.