Order books by price and by order
Price levels, order queues, market depth, implied prices and matching events, and how CME MDP 3.0 sends them.
An order book lists the orders resting on an exchange for one instrument: bids (orders to buy) and asks (orders to sell), each at a price and a quantity. A market data feed cannot send the whole book with every change, so it sends the book once and then every change to it. Feeds describe a book in two ways, by price and by order, and many venues send both.
Price levels
A price level is one price on one side of the book with the total quantity resting there and, on most feeds, how many orders make it up. A feed that sends levels is called market by price (MBP), and the book it describes is a level book. Levels are numbered from 1 for the best price on each side: the highest bid and the lowest ask.
Market depth
A level book holds only the best few prices a side. That number is its depth: with a depth of five, the feed sends the five best bids and the five best asks, and nothing about any price behind them. Orders at the prices behind still rest at the exchange and still trade when an incoming order reaches them; the level book does not carry them.
The figures below are SR3Z6-SR3H7, a calendar spread of SOFR futures whose level book is five deep, in the bundled CME capture. A dashed rule on each side marks where the level book ends, and the prices past it are faded: their orders rest, but no level of the feed describes them.
A better price pushes the last level out of the level book:
The feed does not send the five bids again. It sends only the entry that changed, in an MDIncrementalRefreshBook46: what happened (MDUpdateAction) and at which place of the level book (MDPriceLevel, 1 for the best price):
The receiver moves the five bids it held down one place itself, which pushes 22.5 to level 6, past the level book, and drops it there. No entry names 22.5.
A level that empties pulls the next price in from behind:
fills at message 5,158 · SR3Z6-SR3H7 · trade 25.0 · seller took 84
- 730200000959025.0−84FIFOleft the book1st of 1
Here a trade empties the level, and the feed sends the trade first, in an MDIncrementalRefreshTradeSummary48:
Then the level book's changes, two messages later:
The Delete moves every bid behind 25.0 up one place, which leaves level 5 empty, and the New fills it with the price that rested past the level book. Between the two, message 5,156, an MDIncrementalRefreshVolume37, carries the traded volume, and message 5,158, an MDIncrementalRefreshOrderBook47, removes the filled order from the order book.
Since an entry names a place in the book the receiver holds, a receiver that misses one message puts every later level in the wrong place. CME numbers every packet (MsgSeqNum) and every update of an instrument (RptSeq), so a receiver sees the gap and rebuilds the book from the recovery feed.
What the depth hides is everything past it. A level book cannot say how much rests behind its last level, or whether anything does. An order large enough to take every level shown walks on to prices the level book never described, so its average price, and the price it ends at, cannot be known from the level book. A market by order feed sends every resting order at every price, so a book built from it has no such limit.
Order queues
A feed that sends market by order (MBO) sends every resting order with its own id, side, price and quantity. Orders at one price form a queue, and an order's place in it decides when it fills: under first in, first out matching, the front of the queue fills first (how an exchange fills a queue).
tradedleft the book ✕
Walking the book
An incoming order trades with the best price on the other side first: a buy with the lowest ask, a sell with the highest bid. When it takes everything at that price it walks on to the next, until it is filled or the next price is worse than its limit. At each price the queue fills by the product's match algorithm; the playground below fills first in, first out. What a limit order has left joins the book at its own price, where it becomes the new best bid or ask; what a market order has left goes unfilled.
best bid99.75best ask100.25spread0.50
The further an order walks, the worse its later prices, and that cost is its price impact, which traders also call slippage. The order the playground starts with takes 17 contracts at 100.25 and 20 at 100.50, so its 37 contracts average (17 × 100.25 + 20 × 100.50) / 37 ≈ 100.385, 0.135 above the best ask it met. Once an order's walk ends, the figure works out its price impact under the steps.
Implied prices
Some prices come from other books. A calendar spread is one instrument that buys one expiry of a future and sells another, and its price is the difference of the two. A trader can build the same position from the two expiries: buying the first and selling the second is buying the spread. So a bid resting in the first expiry and an ask resting in the second together make a bid for the spread, at the difference of their prices, for as many contracts as the smaller of the two. That is an implied price: no order rests in the spread at it. It works the other way too: a bid in the spread and a bid in the second expiry together buy the first, at the sum of their prices.
The table works both out for SR3Z6-SR3H7, which buys December 2026 SOFR futures (SR3Z6) and sells March 2027 (SR3H7):
| Implied | Made of the resting | Price | Quantity | Against the book |
|---|---|---|---|---|
| SR3Z6-SR3H7 bid | SR3Z6 bid 95.785 × 34,781 and SR3H7 ask 95.535 × 27,184 | 95.785 − 95.535 = 0.250 → 25.0 | min(34,781, 27,184) = 27,184 | the feed's implied bid: 27,184 at 25.0 |
| SR3Z6-SR3H7 ask | SR3Z6 ask 95.790 × 973 and SR3H7 bid 95.530 × 28,321 | 95.790 − 95.530 = 0.260 → 26.0 | min(973, 28,321) = 973 | the feed's implied ask: 973 at 26.0 |
| SR3Z6 bid | SR3Z6-SR3H7 bid 25.0 × 260 and SR3H7 bid 95.530 × 28,321 | 95.530 + 0.250 = 95.780 | min(260, 28,321) = 260 | behind the best bid, 95.785 |
| SR3Z6 ask | SR3Z6-SR3H7 ask 26.0 × 218 and SR3H7 ask 95.535 × 27,184 | 95.535 + 0.260 = 95.795 | min(218, 27,184) = 218 | behind the best ask, 95.790 |
Open at this message · SR3Z6 at this message · SR3H7 at this message
An exchange that computes implied prices trades against them as it trades against resting orders, so a trade can happen at a price where nobody rests an order: a sell of the spread at 25.0 can fill 27,444 contracts though the spread's own book holds 260 there, and the exchange fills the two legs behind the other 27,184. Its feed sends implied prices as levels of their own, with a quantity and no orders, so a book shows them beside the resting orders' levels.
Matching events
One trade changes many things at once: the trade itself, the traded volume, the levels it emptied, each order it filled, and the implied prices built from them. An exchange sends these as several messages, and the book is in a consistent state only after the last of them, so the feed marks where each such group ends.
Joining a feed late
A recording that starts during a trading session misses the orders placed before it. Their quantity still shows in the levels, so a book rebuilt from orders alone comes out short.
Exchanges repeat the full book on a separate recovery feed for receivers that join late or lose packets. A receiver replaces its book with the snapshot and applies the incremental feed from there.
At CME
Depth and levels
Each instrument's definition, such as MDInstrumentDefinitionFuture54 for a future, lists the books CME sends for it in NoMDFeedTypes: the GBX entry's MarketDepth is the depth of its level book, and the GBI entry's the depth of its implied book. Most futures have ten levels a side; the SOFR futures and their spread in the bundled CME capture have five.
A level entry's MDUpdateAction is New, Change or Delete, and its MDPriceLevel is a place in the receiver's level book, so the receiver moves the levels the entry does not name. The messages above follow these rules:
| Change | Entries CME sends | What the receiver does |
|---|---|---|
| a better price arrives | New at level 1 | moves every level down one; the level pushed past 5 is dropped, and no entry names it |
| a level empties | Delete at its level, then New at level 5 for the price behind, when there is one | moves the levels behind the emptied one up one; the New fills the last place |
| a level's quantity or order count changes | Change at its level | updates that level only |
Order ids and priority
At CME each order carries OrderID and MDOrderPriority, and a lower priority number stands ahead. An order keeps its place when its quantity goes down. It loses its place and joins the back of the queue when its quantity goes up, its price changes or its account number changes.
CME sends both views in the same messages. A book update carries the changed levels in one repeating group (NoMDEntries) and the order changes that caused them in another (NoOrderIDEntries):
// semantic type X · since v9
// MDIncrementalRefreshBook
MDIncrementalRefreshBook46 :: message @46 {
// Start of event processing time in number of nanoseconds since Unix epoch
TransactTime: uInt64 :: type uint64; // uInt64uInt64; @60
// Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event
MatchEventIndicator: MatchEventIndicator :: set uInt8 // 1 B bit setMatchEventIndicator; @5799
// padding
// Number of entries in Market Data message
NoMDEntries: group @268 {
// Market Data entry price
MDEntryPx: PRICENULL9 :: composite // Optional Price with constant exponent -9PRICENULL9 optional; @270
// Market Data entry size
MDEntrySize: Int32NULL :: type int32 optional; // null 2147483647Int32NULL optional; @271
// Security ID
SecurityID: Int32 :: type int32; // int32Int32; @48
// Market Data entry sequence number per instrument update
RptSeq: uInt32 :: type uint32; // uInt32uInt32; @83
// In Book entry - aggregate number of orders at given price level
NumberOfOrders: Int32NULL :: type int32 optional; // null 2147483647Int32NULL optional; @346
// Aggregate book level
MDPriceLevel: uInt8 :: type uint8; // uInt8uInt8; @1023
// Market Data update action
MDUpdateAction: MDUpdateAction :: enum uInt8 // 1 BMDUpdateAction; @279
// Market Data entry type
MDEntryType: MDEntryTypeBook :: enum CHAR // 1 BMDEntryTypeBook; @269
// Tradeable qty
TradeableSize: Int32NULL :: type int32 optional; // null 2147483647Int32NULL optional; @37719 [since v10]
// padding
}
// Number of OrderID entries
NoOrderIDEntries: group @37705 {
// Unique Order ID
OrderID: uInt64 :: type uint64; // uInt64uInt64; @37
// Order priority for execution on the order book
MDOrderPriority: uInt64NULL :: type uint64 optional; // uInt64 optionaluInt64NULL optional; @37707
// Visible qty of order
MDDisplayQty: Int32NULL :: type int32 optional; // null 2147483647Int32NULL optional; @37706
// Reference to corresponding Price and Security ID, sequence of MD entry in the message
ReferenceID: uInt8NULL :: type uint8 optional; // uInt8NULLuInt8NULL optional; @9633
// Order book update action to be applied to the order referenced by OrderID
OrderUpdateAction: OrderUpdateAction :: enum uInt8 // 1 B · since v7OrderUpdateAction; @37708
// padding
}
}
PRICENULL9 :: composite {
mantissa: int64 optional; // null 9223372036854775807
exponent :: -9;
}| Message | Carries |
|---|---|
| MDIncrementalRefreshBook46 | changed levels and, inside level depth, the order changes behind them |
| MDIncrementalRefreshOrderBook47 | order changes outside level depth, and order changes sent apart from a book update |
| MDIncrementalRefreshTradeSummary48 | each trade, its aggressor and the resting orders it filled |
Open MDIncrementalRefreshBook46 in the CME schema
The implied book
CME's matching engine computes implied prices from the outright futures and trades against them. MDP 3.0 publishes at most two implied levels a side, the GBI entry's MarketDepth, as level entries of MDEntryType E (implied bid) and F (implied offer), with quantity and no orders. The bundled CME capture sends them for the spread only.
End of an event
CME groups the messages of one trade into a matching event and marks its last message with the EndOfEvent flag in MatchEventIndicator. Inside an event, an order can already show its fill while its level still holds the old size.
Recovery
CME's recovery feed is the snapshot feed: SnapshotFullRefresh52 carries the levels and SnapshotFullRefreshOrderBook53 the orders (recovery in brief).
In the Market Data Visualizer
Each book pane draws one row per tick, asks above and bids below, with these columns on each side:
- size and ord: the level's total quantity and order count, the market by price view.
- order blocks: one block per resting order in priority order, the front of the queue next to
ordand the back at the pane's edge, each as wide as its quantity, the market by order view. - price: in display units (
7810.25forESZ6,95.785forSR3Z6).
Hover a block for its order card: id, quantity, place in the queue, contracts ahead, the messages that added and changed it, its fills and the match algorithm. A queue that does not fit folds its tail into a striped block; pinch or hold Cmd/Ctrl with the wheel to zoom in.
Past the level book's depth, size and ord are the sums of the orders the book knows. The Market Data Visualizer plays and steps by whole matching events, so a book is never drawn halfway through one.
Implied prices show per book under Display → Implied, as a faint impl column beside each side's size:
Where a recording starts late, the Market Data Visualizer draws the orders it knows and puts the quantity it cannot explain in one hatched block at the front of the queue, since those orders arrived first. Past the level book's depth it draws only the orders it knows. In the bundled CME capture, the equity channels start with a channel reset, so their books are whole from the first message, while the SOFR channel starts partway through the session:
The SOFR snapshot arrives 20 seconds in, and the book becomes whole:
Read on
- Replay CME order books from a pcap capture
- How an exchange fills a queue: first in, first out, allocation and pro rata
- Find trades, resets and gaps in a CME capture
- CME MDP 3.0
Sources
- https://cmegroupclientsite.atlassian.net/wiki/spaces/EPICSANDBOX/pages/457323107/MDP+3.0+-+Message+Specification
- https://cmegroupclientsite.atlassian.net/wiki/spaces/EPICSANDBOX/pages/457574047/MDP+3.0+-+Market+by+Price+-+Multiple+Depth+Book
- https://cmegroupclientsite.atlassian.net/wiki/spaces/EPICSANDBOX/pages/457218479/Supported+Matching+Algorithms
Reviewed by Structure on 2026-11-25. Last changed 2026-11-25.