ReplacingMergeTree with indexed_at as the version column. Rows are identified by each table’s ORDER BY key; when identical keys are inserted more than once, the greatest indexed_at wins during background merges.
markets
Primary table containing prediction market metadata from all supported platforms. Availability: All ClickHouse tiers, including all retained market history during trials. See Markets for the distinction between account access and source coverage.Schema
Resolution Fields
Indexing Fields
Outcomes Structure
Theoutcomes column is an array of named tuples:
Market Types
Market Statuses
fills
Normalized execution records from supported platform and product feeds. Participant identifiers are populated only when the source exposes them. Availability: All retained fill history on paid ClickHouse tiers; trials normally receive the last 7 days. This is an access entitlement, not a guarantee of complete venue history.Schema
Indexing Fields
Outcome Structure
Theoutcome column is a named tuple:
Taker Side
taker_side is not directly comparable across every source. In particular, current Kalshi binary fills are stored as BUY; the source side selects the bought Yes/No outcome. Polymarket binary fills use BUY/SELL relative to exchanging quote currency and outcome tokens. See Fills before aggregating by this field.
orderbook_snapshots
Orderbook depth snapshots per market outcome, written when the book state changes. Each row captures the full bid/ask ladder at a point in time. Availability: Orderbook and Custom ClickHouse tiers. Paid credentials receive all retained history; trials normally receive the last 7 days.Polymarket data is available from November 20, 2025, with high-quality, high-frequency snapshots beginning February 17, 2026; earlier data may have lower capture frequency and gaps. Kalshi orderbook data is available from May 8, 2026. Coverage dates describe observed dataset availability, not a guarantee that every transition is contiguous; use the quality fields below.
Schema
For complete-book semantics, row ordering, quality fields, historical defaults, and venue-specific reconstruction, see Orderbook Snapshots.
Bid/Ask Structure
Each level in thebids and asks arrays is a named tuple:
Computed Fields
BBO, spread, and mid-price are not stored — compute them at query time:- best_bid =
bids[1].price(first level in descending bids) - best_ask =
asks[1].price(first level in ascending asks) - spread =
asks[1].price - bids[1].price - mid_price =
(bids[1].price + asks[1].price) / 2
Example: Bid-Ask Spread Over Time
Table Relationships
Join example:
Ordering & Partitioning
Understanding table ordering helps write efficient queries.markets
platform and id align with the sorting key. A created_at filter is still useful for reducing the requested range, but it is not part of the current sort key.
fills
- Queries filtering by
platform+market_idare fastest - Monthly partitions on
timestampallow efficient date range pruning
orderbook_snapshots
- Queries filtering by
market_id+outcome.idare fastest - Daily partitions on
timestampallow efficient date range pruning - Preserve
path_indexwhen ordering states that share a timestamp
Data Types Reference
DateTime64(6) / DateTime64(9)
Microsecond (6) or nanosecond (9) stored precision timestamps in UTC. Precision indicates storage scale, not guaranteed source-clock accuracy.Decimal128(18) / Decimal64(6)
High-precision decimals for financial values.Decimal128(18) has 18 decimal places (used for fill prices/sizes). Decimal64(6) has 6 decimal places (used for orderbook levels).