Polymarket does not expose historical order book depth through any public API. If you want to backtest a strategy, or build an agent that reasons about prediction markets, you are stuck with whatever you can scrape off the current state of the book. No history, no depth arrays, nothing.
Here is what that problem actually looks like from an infrastructure angle, and how we ended up solving it.
The data problem
Order book depth is not a small dataset. Capturing every bid and ask level, at every change, across a hundred plus markets, adds up fast. We are storing this at millisecond resolution, which means for any single market you are not looking at one row per minute, you are looking at potentially dozens of rows per second during active trading.
We chose ClickHouse for this specifically because it handles high cardinality time series data at this volume without falling over. Right now that is 1B+ tick level snapshots across crypto, sports, economics, weather, social, equities, and Hyperliquid perpetual futures. A standard Postgres setup would choke on query latency at this scale once you start doing range scans across millions of rows per market.
The access problem
Once you have the data, the harder question is how people actually want to use it, because that varies a lot by who is asking.
Someone building a trading bot wants a REST API they can hit programmatically. Someone watching markets live wants a WebSocket stream, not polling. Someone building an AI agent wants to just ask questions in plain language and get structured answers back, which is where MCP comes in.
We built an MCP server specifically for that last group. If you are running Claude or another agent and want it to reason about historical market data directly, instead of writing custom API integration code, you can connect it and query market history conversationally. Setup docs are here: resolvedmarkets.com/docs/mcp.
What this actually enables
The interesting part is not the data itself, it is what becomes possible once the data exists. You can now check whether a price move was backed by real depth or a thin order getting picked off. You can backtest whether a strategy would have actually filled at the price a chart implies, versus what the book actually showed at that timestamp. You can build an agent that pulls historical snapshots and reasons about market microstructure without you writing the query logic by hand.
None of this is possible with top of book price data alone, which is all that is publicly available right now.
Try it
Free tier gives you BTC data with 24 hours of history, enough to see if the resolution and structure actually work for what you are building. Full docs and MCP setup at resolvedmarkets.com.

Top comments (0)