6.4.1Order Flow & Tape Reading

Understand Level-2 - market depth data

2,121 words10 min readdifficulty · medium4 backlinks

WHAT is Level-2 data?

WHY it exists: Modern exchanges match orders by price-time priority. To do that they must keep an ordered queue of every unfilled limit order. Level-2 is simply that queue made visible to you.

Figure — Understand Level-2  -  market depth data

HOW the book is structured (derive it from the matching rule)

Start from first principles: an exchange wants to match a buyer and seller only when prices cross. So it stores orders in two sorted stacks.

Bid side (buyers): sorted from highest price at top downward. Reason (WHY): the buyer offering the most money deserves to trade first → highest bid has priority.

Ask side (sellers): sorted from lowest price at top upward. Reason: the seller asking the least deserves to sell first → lowest ask has priority.

The top of book = highest bid meets lowest ask. By construction:

Bidbest<AskbestSpread=AskbestBidbest>0\text{Bid}_{best} < \text{Ask}_{best} \quad\Rightarrow\quad \text{Spread} = \text{Ask}_{best} - \text{Bid}_{best} > 0

Within one price level, orders are queued by time (FIFO): first order in = first filled. This is why joining a big queue late means you may never get filled at that price.


Cumulative depth (the quantity that traders actually watch)

Each level shows size qiq_i. The useful object is cumulative depth — how much total volume you'd sweep if you kept buying/selling into the book.

Let ask levels be prices p1<p2<p_1 < p_2 < \dots with sizes q1,q2,q_1, q_2, \dots. To buy QQ shares by hitting the offers, the cumulative shares available up to level kk:

Ck=i=1kqiC_k = \sum_{i=1}^{k} q_i

The average fill price for a market buy of size QQ (marketable order eating levels until filled):

Pˉ(Q)=i=1kpixiQ,xi=shares taken from level i, xi=Q\bar{P}(Q) = \frac{\sum_{i=1}^{k^*} p_i\, x_i}{Q}, \qquad x_i = \text{shares taken from level } i,\ \sum x_i = Q

where you fill level 1 fully, then level 2, etc., until QQ is exhausted at level kk^*.


Worked Examples

Consider this book snapshot for stock XYZ:

Bid Size Bid Ask Ask Size
300 100.00 100.05 200
500 99.95 100.10 400
800 99.90 100.15 1000

Forecast-then-Verify drill

Before reading on: You place a market buy of 700 shares into Example 1's book. Forecast the average price.

Verify

200@100.05 + 400@100.10 + 100@100.15 = 20010 + 40040 + 10015 = 70065. \bar P = 70065/700 = \100.0929. Slippage ≈ \0.0429. You should have predicted a higher average than Example 2 because 700 > 500 digs deeper.


Common Mistakes (Steel-manned)


Active Recall

Recall Self-test (hide and answer)
  1. Why can the best bid never exceed the best ask in a resting book?
  2. Derive the slippage formula and say what makes each term positive.
  3. Why doesn't large bid depth guarantee a price rise?
  4. What is the difference between Level-1 and Level-2 data in one sentence?
Recall Feynman: explain to a 12-year-old

Imagine an ice-cream stall. Level-1 just tells you the price of the last cone that was sold. Level-2 lets you peek at two queues: one line of kids wanting to buy (each holding up how many cones and the price they'll pay) and one line of sellers. The stall matches the kid paying the most with the seller asking the least. If you want to buy a LOT of cones at once, you gobble up the cheapest sellers first, then have to take costlier ones — so your average price creeps up. That creep is slippage. And a huge line of buyers doesn't mean prices jump — those kids are just waiting; they might walk away any second.


Connections

  • Order Flow & Tape Reading — the tape is the executions; Level-2 is the intentions.
  • Bid-Ask Spread — the residual gap this note derives.
  • Slippage & Market Impact — direct consequence of finite depth.
  • Limit vs Market Orders — limit orders build the book, market orders consume it.
  • Order Book Imbalance Signals — quantifying pressure from depth.
  • Spoofing & Layering — why depth can lie.
  • Price-Time Priority — the matching rule that generates the whole structure.

What does Level-1 market data show?
Best bid, best ask, and last traded price with size — only the top of the book.
What does Level-2 (market depth) data show?
The full list of resting limit orders on both sides, with size available at each price level.
How are bids sorted in the order book?
Highest price at the top, descending (highest buyer has priority).
How are asks sorted?
Lowest price at the top, ascending (lowest seller has priority).
Why is the resting spread always positive?
Any crossing (bid ≥ ask) is instantly matched and removed, so only non-crossing orders rest, leaving best-bid < best-ask.
Define the spread formula.
Spread = Ask_best − Bid_best.
What is slippage?
The difference between your average fill price and the top-of-book price when your order eats through multiple levels: (Σ p_i x_i)/Q − p₁.
What tie-breaks orders at the SAME price level?
Time priority (FIFO) — first order placed is first filled.
Why doesn't large bid depth guarantee price goes up?
Resting bids are passive/patient and may be spoofed or pulled; only aggressive market orders (the tape) actually move price.
What liquidity is invisible in Level-2?
Hidden/iceberg orders and dark-pool size — displayed depth understates true depth.
Order-book imbalance formula?
(Q_bid − Q_ask)/(Q_bid + Q_ask), bounded in [−1, +1].
Which order type consumes the book vs builds it?
Market orders consume resting liquidity; limit orders add/build the book.

Concept Map

expands into

visualizes

forces exchange to keep

sorted highest first

sorted lowest first

best bid vs best ask

best bid vs best ask

gap defines

stays positive because crossings

same-price ordered by

same-price ordered by

sum of sizes per level

determines

Level-1 top of book

Level-2 market depth

Order book queue

Price-time priority rule

Bid side buyers

Ask side sellers

Top of book

Spread Ask minus Bid

Instant execution removes crossings

Time priority FIFO

Cumulative depth

Average fill price

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, Level-1 data sirf itna batata hai ki last trade kis price pe hua aur top pe best bid–best ask kya hai. Lekin Level-2 (market depth) ek jhaanki deta hai poore order book ki — yaani buyers ki poori line (bids) aur sellers ki poori line (asks), har price level pe kitni quantity wait kar rahi hai. Bids hamesha upar se neeche high-to-low sort hote hain (jo sabse zyada de raha hai usko pehli priority), aur asks low-to-high (jo sasta bech raha hai usko pehli priority). Beech ka gap = spread.

Ab sabse important cheez: jab aap ek bada market order maarte ho, toh aap pehle sabse best price wala level khaate ho, phir agar quantity bachi toh next worse level pe jaate ho. Isi wajah se aapka average price top price se bigad jaata hai — isi bigadne ko slippage kehte hain. Chhota order = kam slippage, bada order = zyada slippage. Yehi reason hai ki thin (patla) book mein bade order mehenge padte hain, chahe spread tight ho.

Ek badi galti jo naye traders karte hain: "bid side pe bahut size hai, matlab price upar jayega." Bhai, yeh passive orders hain — yeh sirf wait kar rahe hain, khud se price nahi badhaate. Woh spoof bhi ho sakte hain (fake, execute hone se pehle cancel). Price ko sirf aggressive orders (jo tape pe execute hote hain) hilaate hain. Isliye rule yaad rakho: Depth = patience, Tape = action. Aur yaad rahe — jo dikh raha hai wahi sab kuch nahi; hidden aur iceberg orders screen pe nazar nahi aate.

Test yourself — Order Flow & Tape Reading

Connections