02 / SCHEMA
Know what each row means before it enters a model.
A compact field reference for the four tables used in a typical Polymarket BTC 5m / 15m order-book backtest.
Ticks / best quotes
A ticks row is written when all four best quotes exist and at least one best quote changes. It is event-driven, not a fixed-frequency sample.
| Field | Meaning |
|---|---|
ts / ts_sec / datetime | Collection timestamp in multiple convenient forms. |
event_slug | Market event key used to join all related records. |
poly_up_bid / ask | Best bid and ask for the UP token. |
poly_down_bid / ask | Best bid and ask for the DOWN token. |
up_mid / down_mid | Midpoint derived from the corresponding best bid and ask. |
up_spread / down_spread | Best ask minus best bid. |
window_start_ts / window_end_ts | Market window boundaries; 5m uses 300 seconds and 15m uses 900 seconds. |
offset_s | Seconds relative to the market window start. |
Depth / order-book levels
Depth rows describe one outcome and one side at one price level. A complete snapshot can contain two outcomes × two sides × up to 20 levels.
| Field | Meaning |
|---|---|
event_slug | Market key used to join metadata and outcomes. |
outcome | UP or DOWN. |
side | BID or ASK. |
level | 1-based book level; level 1 is the best available level. |
price | Displayed token price at this level. |
size | Displayed token size, not guaranteed execution volume. |
window_start_ts / window_end_ts | Market window boundaries. |
offset_s | Seconds relative to the market window start. |
Outcomes and market metadata
market_outcomes contains post-event labels: winner_side and target, where UP maps to 1 and DOWN maps to 0.
seen_markets contains market_id, condition_id, UP/DOWN asset IDs, and the window timing needed to connect an event to its market records.
Do not use winner_side or target as a predictive feature. They are labels available only after the market resolves.