Data SchemasPolymarket US
L2
Schema for Polymarket US L2 order books.
All fields come from the raw Polymarket US WebSocket message. PMData adds only the receive timestamp local_timestamp.
Data type: l2 (polymarket_us)
Source: SUBSCRIPTION_TYPE_MARKET_DATA, message marketData. One file per market per UTC day. Polymarket US sends the complete book in every message, so every row is a full order book. Prices are the price of the market's long outcome (the catalog's yes_outcome).
| Field | Type | Description |
|---|---|---|
market_slug | string | Polymarket US market slug. Source: marketData.marketSlug. |
timestamp | timestamp[ns] | Polymarket US transaction time. Source: marketData.transactTime. |
local_timestamp | timestamp[ns] | PMData receive timestamp. |
event_type | string | Message type: marketData. |
bid_prices | list<double> | Bid prices in US dollars (0 to 1), best first. Source: marketData.bids[].px.value. |
bid_sizes | list<double> | Contracts at each price in bid_prices; can be fractional. Source: marketData.bids[].qty. |
offer_prices | list<double> | Offer (ask) prices in US dollars, best first. Source: marketData.offers[].px.value. |
offer_sizes | list<double> | Contracts at each price in offer_prices. Source: marketData.offers[].qty. |
state | string | Market state, as sent: MARKET_STATE_OPEN, MARKET_STATE_PREOPEN, MARKET_STATE_SUSPENDED, MARKET_STATE_HALTED, MARKET_STATE_EXPIRED, MARKET_STATE_TERMINATED, MARKET_STATE_MATCH_AND_CLOSE_AUCTION. Source: marketData.state. |
- To replay, replace the whole book with each row.
- Not stored:
marketData.stats(last trade price, volume, open interest, high and low), which are statistics rather than the book.
Timestamps
All timestamps are UTC with nanosecond precision (timestamp[ns]). pandas reads them as datetime64[ns].
