Choose Between Quote Snapshots and Candles for Research
Pick the wrong data shape and your whole study inherits a quiet bias. Candles are compact and cover years. Orderbook snapshots are heavy and only describe one moment. Neither is better in general. The right choice depends on the exact question you are asking, and more precisely on which fields that question actually reads. This post builds a field-level comparison so you can match a research question to the minimum data that can answer it honestly.
This builds on the general data-gap discussion in /blog/prediction-market-backtest-data-gaps. Here the focus is narrower: snapshot versus candle, field by field, with a worked example of what a candle structurally cannot tell you.
What each source actually contains
Start with the primary source rather than intuition. On Kalshi, a candlestick for a market is a structured object. Each candle carries an end_period_ts, three OHLC sub-objects for yes_bid, yes_ask and the traded price, plus volume and open interest. The traded-price block exposes open, high, low, close and mean. Note that field naming differs between the two endpoints: the live series endpoint uses dollar-string suffixes (open_dollars, high_dollars, low_dollars, close_dollars, mean_dollars), while the historical endpoint uses plain names (open, high, low, close, mean). The live endpoint additionally exposes min_dollars and max_dollars on the price block; the historical endpoint does not include those fields. Treat these as two distinct schemas when writing a data pipeline that spans both.
Candles come in three fixed periods. The market candlesticks endpoint accepts a period_interval of 1 (minute), 60 (hour) or 1440 (day). Intervals with no trades are documented as nullable: the price OHLC can come back null with volume zero while open interest stays populated. If you forward-fill those nulls you are inventing prices, so treat them as missing, not as flat.
An orderbook snapshot is a different object entirely. The Get Market Orderbook endpoint returns the current state of resting bids for a market. One important structural point: Kalshi returns both YES bids and NO bids, but no ask arrays. A YES bid at price X implies a NO ask at (1.00 - X), and a NO bid at price Y implies a YES ask at (1.00 - Y). So to find the best YES ask, take 1.00 minus the best NO bid. The snapshot describes the present moment and resting size at each level. It is not a time series.
The field-level split
Questions that an OHLC candle can answer, because they only read summarized price and volume over an interval:
- Directional and trend studies: did the YES price drift up or down across a day or an hour, using price open versus close.
- Realized range and volatility proxies: high minus low per bar, or close-to-close moves.
- Event-window studies: where did the traded price sit before and after a scheduled release, at minute resolution.
- Activity and liquidity-proxy filters: rank or screen markets by volume and open interest per bar.
- Long-horizon coverage: anything that needs months or years of history, where storing every snapshot is impractical.
Questions that require live bid/ask snapshots, because they read the spread or depth at a specific instant, not a summary:
- Spread capture and quoting studies: the distance between the best YES bid and the implied YES ask (derived from the best NO bid) at the moment you would act.
- Fillability and slippage: how many contracts rest near the top of book, and how far price walks if you take size.
- Resting-order placement: where your passive quote would sit in the queue relative to existing bids.
- Microstructure timing: book imbalance, quote flicker, or how the book reacts between trades.
- Anything needing the ask side with depth: candles include yes_bid and yes_ask OHLC summaries, but not the full resting ladder behind them.
The intrabar example a candle cannot reconstruct
This is a hypothetical, with chosen inputs, to show a structural limit. It is not a market observation. Suppose a one-hour YES-price candle reports open 0.41, high 0.47, low 0.38, close 0.45, volume 12840 contracts.
# HYPOTHETICAL candle (chosen inputs, not a real market)
candle = {
"period_minutes": 60,
"price": {"open": 0.41, "high": 0.47, "low": 0.38, "close": 0.45},
"volume": 12840,
}
# Question: if I wanted to buy 500 YES contracts at 09:17,
# what was the best ask, and how far would 500 walk the book?
# The candle cannot answer this. It has no timestamp at 09:17,
# no per-level ask ladder, and no resting size.
The candle tells you a trade printed as low as 0.38 and as high as 0.47 during the hour. It does not tell you when, in what order, or whether 0.38 and 0.47 happened seconds apart or 40 minutes apart. The path 0.41 up to 0.47, back to 0.38, then settling at 0.45 is indistinguishable from a dozen other paths with the same four extremes. More to the point for execution research: a close of 0.45 means a trade printed there, not that 500 contracts could have filled near it. The candle has no resting depth, so it cannot answer a fillability question at any instant inside the bar. Only a snapshot taken at that instant can.
The general rule: candles summarize what traded, snapshots describe what was available. If your question reads availability, spread, or queue position, no amount of candle processing recovers it.
Prices are decimals, so parse them as decimals
Kalshi returns these prices as strings like "0.5600". Parse them with Python's decimal module, not binary float. The standard library notes that decimal arithmetic is exact and avoids the representation error where, for example, 0.1 cannot be represented exactly in binary floating point. For penny-tick prediction-market prices this matters: spread and edge comparisons near a cent are exactly where float rounding bites. Keep the string, feed it to Decimal, and do your spread and P&L math there.
Where this lands in a paper workflow
If you are prototyping a strategy against current data, match the data shape to the callback. Banger is a paper-research beta that consumes public Polymarket and Kalshi market data for paper testing, without venue trading keys. Its strategy callback is on_market_tick(self, market, tick, ctx), where tick prices are Decimal, bid and ask can be absent, and the timestamp is a datetime. That absent-quote case is the same gap discussed above: a spread-dependent rule has to handle a missing bid or ask explicitly rather than assume one. Hosted historical backtesting currently targets Kalshi binary markets. A paper result is evidence under a specific data, fill, fee and valuation model, not a promise of real-venue execution or returns.
Practical default: reach for candles when your question reads a price summary over time and you need breadth or history. Reach for orderbook snapshots when your question reads the spread, the ask ladder, or resting depth at a moment. When in doubt, write down which field answers the question. If that field is high, low, close or volume, a candle is enough. If it is best bid, best ask, or size-at-level, you need the book.
One link, and an invitation
For the authoritative field names and nullability rules, start at the Kalshi API documentation and read the market candlesticks and orderbook pages directly, since field definitions change. If you want to try these ideas as bounded paper experiments against current data, you can explore paper research via /sign-up. No fills, returns, or profitability are promised; a paper run is evidence under one model, nothing more.
Sources
- Get Market Candlesticks - Kalshi API Documentation
- Get Historical Market Candlesticks - Kalshi API Documentation
- Orderbook Responses - Kalshi API Documentation
- Get Market Orderbook - Kalshi API Documentation
- Quick Start: Market Data - Kalshi API Documentation
- Kalshi Prediction Markets - Scalar Field (candlestick nullability and fields)
- decimal - Decimal fixed point and floating point arithmetic - Python documentation
- Banger - Polymarket & Kalshi Paper Strategies
- bangertrades - PyPI