Guides / API Guide
ProbSights records the book as periodic snapshots, not as an event stream of individual order placements and cancels. That distinction defines what you can rebuild: how depth looked at each sampled instant, and therefore what a trade would have cost — but not the sequence of individual orders between two samples.
Polymarket snapshots carry bids and asks; Kalshi's carry
yes_bids and no_bids, because a No bid is the mirror of the Yes
book. Both are arrays of { price, size }, alongside derived
best_bid/best_ask (or best_yes_bid/best_yes_ask),
mid, and spread.
granularity=1m, following
pagination_key to the end.timestamp — do not assume page order is time order.This is the whole point of keeping depth rather than just mid-price. To buy n
contracts, consume ask levels in price order until filled:
def fill_cost(levels, qty):
cost = filled = 0
for level in levels: # already price-ordered
take = min(qty - filled, level["size"])
cost += take * float(level["price"])
filled += take
if filled >= qty:
return cost / filled # average fill price
return None # book too thin for this size
Returning None matters as much as the price: a size the book cannot absorb is
a trade that would not have happened, and a backtest that fills it anyway is inventing
liquidity. See why mid-price
backtests lie.
1m, a spread that blew
out for ten seconds may never appear. Latency-sensitive strategies cannot be validated
this way.Data from Kalshi and Polymarket. Search live API docs Pricing