oddsrail

Notes on the venue APIs

Kalshi has no ask side: two bid ladders, and a NO bid is a YES ask

Kalshi's order book publishes YES bids and NO bids, both ascending, as dollar strings. Getting the translation backwards silently takes the opposite position.

Kalshi's book has no asks in it. GET /trade-api/v2/markets/<ticker>/orderbook returns two arrays, yes and no, and both are bid ladders, ascending, so the best price in each is the last element.

The translation

A YES contract and a NO contract on the same market are worth one dollar together. So somebody bidding 0.25 for NO is, by definition, offering YES at 0.75:

best_yes_ask = 1 - best_no_bid
best_no_ask  = 1 - best_yes_bid

Get that backwards and you do not get an error. You get a position on the side you did not want, at a price that looks plausible, and you find out at settlement.

The second trap in the same response

Prices are dollar strings, not integer cents. The fields carry a _dollars suffix and look like "0.5600"; sizes are fixed-point strings too. Integer cents were removed in March 2026, so any code that multiplies by 100 out of habit is now wrong by two orders of magnitude. Parse with Decimal, not float, if you care about the last cent.

What oddsrail does

It presents one book per market, best-first, with a real bid and a real ask on each side, and lets the agent say what it means:

kalshi_place_order(ticker="...", outcome="no", action="buy", price=0.25, count=10)

The YES-book translation happens inside, in Decimal, and is unit-tested exhaustively rather than by example. One more thing worth knowing before you build on this: Kalshi's Developer Agreement limits API use to a member's own trading, so a hosted multi-tenant service routing other people's Kalshi orders is not permitted. Bring your own key and run it yourself.

Found by driving the venues live, then encoded so an agent never rediscovers it. Reproduce every one of these with no keys: pip install oddsrail && python examples/footguns.py (source).

Try an agent that knows all six All notes