6.3.2Market Microstructure

Learn about limit order book depth

1,932 words9 min readdifficulty · medium4 backlinks

WHAT is a Limit Order Book?


HOW price moves: walking the book

When a market buy of size VV arrives, it eats the ask side from the top:


Figure — Learn about limit order book depth

Worked Example 1 — Small order, one level

Worked Example 2 — Large order, walks two levels

Worked Example 3 — Same order, shallow book


Common Mistakes


Flashcards

What is a limit order (vs a market order)?
A resting order to trade a fixed quantity at a specified price or better; it waits in the book. A market order executes immediately at the best available prices, consuming liquidity.
Define depth at a price level.
The total resting order quantity qiq_i available at that price.
Define cumulative depth QkQ_k.
Qk=i=1kqiQ_k=\sum_{i=1}^k q_i — total volume from the best level through level kk.
Formula for the spread and mid price?
s=a1b1s=a_1-b_1; m=(a1+b1)/2m=(a_1+b_1)/2.
How do you find how many ask levels a market buy of size VV consumes?
The smallest kk with Qk1<VQkQ_{k-1}<V\le Q_k.
Write the VWAP (average) execution price for buying VV.
pˉ(V)=i=1k1qiai+(VQk1)akV\bar p(V)=\dfrac{\sum_{i=1}^{k-1}q_i a_i+(V-Q_{k-1})a_k}{V}.
Define slippage / price impact of a trade.
pˉ(V)m\bar p(V)-m: the extra average cost above the mid caused by walking the finite-depth book.
Why can a tight-spread stock be expensive to trade in size?
If depth is thin, a large order walks into far worse levels, so slippage dwarfs the small spread.
What is order-book imbalance and what does it hint at?
I=QbidQaskQbid+QaskI=\dfrac{Q^{bid}-Q^{ask}}{Q^{bid}+Q^{ask}}; positive II (more bids) suggests short-term upward price pressure.
When walking the book, why weight the last level by VQk1V-Q_{k-1}?
Because the final level is only partially filled — only the remaining shares after exhausting earlier levels come from it.

Recall Feynman: explain to a 12-year-old

Imagine a candy shop where people line up notes saying "I'll SELL you candy for ₹10" or "I'll BUY your candy for ₹9". The sell notes are stacked cheapest-first, the buy notes highest-first. Depth is how many candies each note is good for. If you want to buy 100 candies but the cheapest note only covers 20, you have to grab the next note (a bit pricier), then the next… so buying a lot pushes the price up as you go. A shop with big fat notes (deep book) barely changes price; a shop with tiny notes (thin book) jumps a lot. That's the whole idea!


Connections

  • Bid-Ask Spread — the top-of-book cost; depth explains the cost beyond it.
  • Market Orders vs Limit Orders — who consumes vs supplies liquidity.
  • Price-Time Priority — the matching rule that dictates fill order.
  • Slippage and Market Impact — direct consequence of finite depth.
  • Order-Book Imbalance — depth asymmetry as a short-term price signal.
  • VWAP and TWAP Execution — algorithms that slice orders to avoid walking the book.
  • Liquidity — depth is one of its three pillars (tightness, depth, resiliency).

Concept Map

rests in

split into

split into

top is

top is

gives

gives

averaged for

averaged for

summed into

walks book for

minus mid gives

baseline for

Limit order at set price

Limit Order Book

Bid side buy orders

Ask side sell orders

Best bid b1

Best ask a1

Spread s = a1 - b1

Mid price m

Depth q_i per level

Cumulative depth Q_k

VWAP exec price p-bar

Price impact / slippage

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Socho ek shop mein do lines lagi hain — ek taraf log likh ke rakhte hain "main ₹9 mein KHAREEDunga" (ye hai bid side), aur doosri taraf "main ₹10 mein BECHunga" (ye hai ask side). In sab resting orders ka collection hi limit order book hai. Har price pe kitni quantity padi hai — usko bolte hain depth. Top ki best bid aur best ask ke beech ka gap = spread, aur unka average = mid price.

Ab asli baat: jab tum market buy maarte ho, tum sabse sasti ask se bharna shuru karte ho (price-time priority). Agar tumhara order chhota hai, ek hi level se ban jaata hai — sirf aadha spread ki cost. Lekin agar order bada hai aur upar wala level patla (thin depth) hai, to tumhe agle, mehenge levels tak "walk" karna padta hai. Isse tumhara average fill price (VWAP) mid se upar chala jaata hai — ye extra cost hi slippage / price impact hai. Formula: pˉ(V)=qiai+(VQk1)akV\bar p(V)=\frac{\sum q_i a_i+(V-Q_{k-1})a_k}{V}.

Kyun important hai? Kyunki bahut log sochte hain "spread chhota hai to trade sasta hai" — galat! Agar depth kam hai to same order mein bahut zyada slippage lag sakta hai (dekho Example 2 vs Example 3 — same 700 shares, par thin book mein double impact). Isliye bade traders order ko chote tukdon mein todte hain (VWAP/TWAP algos) taaki book "walk" na ho.

Ek aur cheez — imbalance: agar bid side pe depth zyada hai ask se, to short-term mein price upar jaane ka pressure hota hai (I=QbidQaskQbid+QaskI=\frac{Q^{bid}-Q^{ask}}{Q^{bid}+Q^{ask}}). To depth sirf cost nahi, direction ka bhi hint deta hai. Yaad rakho: "Spread is the door, depth is the room."

Test yourself — Market Microstructure

Connections