DOCS
L3 / market-by-order
Order-by-order depth: every individual resting order with its exchange order id, queue priority and nanosecond timestamp.
requiresL3 / Market-by-order or above
The l3 channel streams depth per order instead of per price level. Every individual resting order is its own event — placed, modified, cancelled or filled — carrying the exchange order id, its queue priority at that price and a nanosecond exchange timestamp. It's included from L3 / Market-by-order or above.
L2 tells you there are 42 contracts bid at 23481.25. L3 tells you those 42 are seven separate orders, in what queue order, and which one just pulled. That's the difference between seeing size and seeing intent — queue position, iceberg detection and order-lifetime studies all need L3.
Subscribe
{ "op": "subscribe", "channel": "l3", "symbols": ["NQ"] }from tickstream import Tickstream
ts = Tickstream("sk_live_…")
for e in ts.stream("NQ", channel="l3"):
print(e["action"], e["order_id"], e["side"], e["price"], e["size"])
L3 is available for the CME futures roots (NQ, ES, YM,
RTY…) — the same symbols as Level 2. Subscribing to
l3 does not replace book: you can run both on one connection, and the
aggregated book frames are built from this very order feed.
The l3 message
{
"type": "l3",
"symbol": "NQ",
"contract": "NQZ6",
"order_id": "7412998336104",
"action": "new",
"side": "bid",
"price": 23481.25,
"size": 3,
"priority": 110934567812,
"seq": 0,
"ord": 1789775234000188,
"snap": false,
"snap_i": 0,
"snap_rows": 0,
"inferred": false,
"ts": 1753900800,
"ns": 412903771
} | Field | Type | Description |
|---|---|---|
contract | string | The front-month contract the root resolved to when the frame was sent, e.g. NQZ6. |
order_id | string | Exchange order id. Stable for the whole life of the order — this is what lets you track one participant's order across modifications. |
action | string | new (order added), change (size/price modified) or delete (cancelled or fully filled). |
side | string | bid or ask. |
price | number | Limit price of this order. |
size | number | Displayed size of this order (not the level total). |
priority | number | Exchange queue priority at that price — lower means closer to the front of the queue. A large opaque number (around 1.1e11); compare, don't interpret. |
seq | number | 0 on order events. Our upstream feed numbers only its order-book snapshots, not the individual order updates, so there is no exchange sequence to pass on. Events arrive and are stored in exchange order; order them by ts/ns, then ord. To prove a book is complete, use the images (below): the book you built must equal the next image. |
snap | boolean | An image: the complete book. Every resting order, each with snap: true and action: "new", numbered by snap_i of snap_rows. Reset your book when snap_i is 1 and apply the rest as adds. You get one on every l3 subscribe, after every l3_lagged (the field image says "subscribe" or "resync"), and the stream carries one every 5 minutes, which are also recorded for replay. Only events newer than an image follow it, so nothing is missing and nothing is applied twice. Before 2026-10-17 an image was only sent when our upstream feed restarted, so older replay windows mostly have none. |
ord | number | Our ingest ordinal: strictly increasing, never reused, assigned in arrival order — the tie-break for events with the same ts/ns. Image rows carry the ord of the last event they contain. Opaque — compare with <, never read it as a timestamp. |
inferred | boolean | true on a delete we derived: the order was resting beyond the best bid or offer, so it traded, and the feed sends no delete for a resting order that fills. Without these deletes a rebuilt book keeps filled orders and crosses. Other deletes come from the exchange (cancels, and fills the exchange reports); to tell a fill from a cancel there, match the delete or size reduction at the touch against a trade at the same price and moment from the ticks channel. |
snap_i / snap_rows | integer | Inside an opening image: this order's 1-based position and the image's total row count, so you know when it is complete. 0 outside an image. |
ts | integer | Exchange timestamp in Unix seconds. |
ns | integer | Nanoseconds within that second, as stamped by the exchange. |
Rebuilding a book from L3
An order feed is a delta feed: apply each event to a map keyed by order_id and you hold
the exact book. Aggregate that map by price whenever you need a level view.
# an L3 stream IS the book — aggregate it whenever you want a level view
book = {} # order_id -> (side, price, size)
def apply(e):
if e["action"] in ("new", "change"):
book[e["order_id"]] = (e["side"], e["price"], e["size"])
elif e["action"] == "delete":
book.pop(e["order_id"], None)
def levels(side):
out = {}
for s, px, sz in book.values():
if s == side:
out[px] = out.get(px, 0) + sz
return sorted(out.items(), reverse=(side == "bid"))
If your connection can't keep up, we send a {"type":"warning","warning":{"code":"l3_lagged","dropped":N}}
frame instead of quietly skipping events, and a fresh image of every L3 symbol you subscribed
follows straight away. Replace your book with it; no resubscribe needed. After a disconnect,
reconnect and subscribe: the first frames are again a complete image.
Rebuild, replay and recovery in one script
History with seed=1 starts complete, the live stream starts with an image, and a lag or reconnect is repaired by the next image. The same apply works for all three.
import json, requests, websocket # pip install requests websocket-client
KEY = "sk_live_…"
book = {} # order_id -> (side, price, size)
def apply(e):
if e.get("snap") and e.get("snap_i") == 1:
book.clear() # an image starts the book over
if e["action"] == "delete" or e["size"] <= 0:
book.pop(e["order_id"], None)
else:
book[e["order_id"]] = (e["side"], e["price"], e["size"])
# 1) history: seed=1 puts the complete book at `start` first, then every event of the window
r = requests.get("https://api.tick-stream.xyz/v1/l3",
params={"symbol": "ES", "start": "2026-10-19T14:30:00Z",
"end": "2026-10-19T14:35:00Z", "seed": 1},
headers={"Authorization": f"Bearer {KEY}"}).json()
for e in r["events"]:
apply(e)
# 2) live: every subscribe and every l3_lagged starts with an image of the whole book,
# and only events newer than that image follow — no buffering, no merging, no gap
ws = websocket.create_connection(f"wss://stream.tick-stream.xyz/?key={KEY}")
ws.send(json.dumps({"op": "subscribe", "channel": "l3", "symbols": ["ES"]}))
while True:
m = json.loads(ws.recv())
if m.get("type") == "ping":
ws.send(json.dumps({"op": "pong"}))
elif m.get("type") == "l3":
apply(m)
# after a disconnect: reconnect and subscribe again; the first frames are a fresh image GET /v1/l3 — replay
Replay recorded order-level events over REST. Retention is a rolling ~7 days, and only
NQ and ES are recorded for replay (the live l3 channel covers more symbols).
The response is {symbol, start, end, count, truncated, contract, contractSince, events: [...]};
each event has the stream's order fields (order_id, action, side,
price, size, priority, seq, ord, snap,
snap_i, snap_rows, ns) but no type or symbol, and its
ts is in microseconds, not seconds.
| Param | Required | Description |
|---|---|---|
symbol | yes | The instrument, e.g. NQ. |
start / end | no | ISO-8601 UTC or Unix seconds. Max window 1 hour per request — an L3 hour is hundreds of thousands of events. Defaults: end = now, start = 5 minutes before. |
limit | no | Max events (default 50,000, max 500,000). |
seed | no | 1 = start the answer with the complete book at start: image rows (snap: true, stamped start), then every event of the window. The response then has seed: {rows, folded_from}. Needs an image recorded within 10 minutes before start (one is recorded every 5 minutes since 2026-10-17); otherwise 409 no_image. |
# start/end must fall inside the last ~7 days
curl "https://api.tick-stream.xyz/v1/l3?symbol=NQ&start=2026-09-25T13:30:00Z&end=2026-09-25T14:00:00Z" \
-H "Authorization: Bearer sk_live_…" There is no vendor archive for order-level data — nobody sells CME MBO history back in time, and our own tick/L2 archive (2019 →) does not contain it either. L3 replay is a rolling ~7-day window of our own recording. If you need L3 for a specific study, tell us the symbol so it's in the recording set: support@tick-stream.xyz.
Without the package, subscribing to l3 returns an error frame {"type":"error","error":{"code":"plan_required",…}} (the socket stays open), and /v1/l3 returns HTTP 403 plan_required. See what the packages include.