The limit order book
M0 — How markets actually work
In M0.1 we said makers post standing offers and wait. The limit order book (LOB) is the thing they post into — the central data structure of a modern market. Understand the book and most of microstructure stops being mysterious.
A limit order is three things
When a maker posts, they specify a side (buy/sell), a price (the worst price they’ll accept), and a quantity.
“Buy 100 @ 49.98” means: up to 100 shares, but I will not pay more than 49.98. A resting promise — it sits in the book until someone trades against it or the maker cancels it (cancellation is constant; more in M1).
Contrast a market order: no price limit — “buy 100, whatever it costs now.” That’s the taker from M0.1. Limit orders build the book; market orders consume it.
Two sides, sorted
The book has a bid side (resting buys) and an ask side (resting sells, aka offers), each sorted by aggressiveness.
THE LIMIT ORDER BOOK (stock: ACME)
BIDS (buyers) │ ASKS (sellers)
price size orders │ price size orders
─────────────────────── │ ───────────────────────
50.00 ◀ 1,200 3 best bid │ best ask 50.02 ▶ 800 2
49.99 3,400 7 │ 50.03 2,500 9
49.98 900 2 │ 50.05 4,100 11
49.95 5,000 4 │ 50.10 1,000 3
best bid 50.00 ──┐
├─ SPREAD = 0.02 (the gap)
best ask 50.02 ──┘
Reading the columns: each row is one price level. size is the total shares resting there; orders is how many separate limit orders add up to that size. So 50.00 · 1,200 · 3 means three different buyers posted orders totalling 1,200 shares at 50.00. The split matters: price-time priority queues those orders individually, and a level held up by one big 1,200-share order behaves very differently from the same size split across many small orders that can each cancel independently — a “wall” that can evaporate in milliseconds.
- Best bid — the highest price any buyer will pay (50.00).
- Best ask — the lowest price any seller will accept (50.02).
Together they’re the top of book (BBO). The gap, 0.02, is the bid-ask spread (its own lesson, M0.4). The book is “inside out”: best bid is the highest buy, best ask the lowest sell — those are the orders most likely to trade. Further down each list, prices get less aggressive and less likely to execute.
Price-time priority
Who trades first? The standard rule is price-time priority:
- Price first — a more aggressive price always wins (a buy at 50.01 jumps ahead of every buy at 50.00).
- Time second — at the same price, earliest arrival trades first.
This is why latency matters (a big M1 theme): at a busy price level, queue position decides whether you fill at all. A microsecond can put you ahead of thousands of shares.
Depth, and “walking the book”
Depth is how much size rests at each level. It tells you how much you can trade without moving the price much. Send a market buy for 2,000 into the book above:
incoming: MARKET BUY 2,000 fills against asks, cheapest first:
▸ 800 @ 50.02 (clears the best ask)
▸ 1,200 @ 50.03 (eats into the next level)
─────────────────────────────
2,000 shares, avg price ≈ 50.026
AFTER: best ask is now 50.03 (1,300 left) — the price moved UP.
This is walking the book: a large order exhausts the best level and fills at successively worse prices. Two crucial ideas:
- Market impact / slippage — a big order pushes the price against itself. The average fill (≈50.026) is worse than the 50.02 you saw. Bigger order vs. available depth → worse slippage. This is why large traders slice orders, and why “the price on the screen” is a polite fiction for size.
- A trade removes liquidity and moves the top of book. Every interaction reprices the book — M0.1’s price discovery, now in mechanical detail.
Marketable limit orders & partial fills
A limit order isn’t always passive. Post “buy 100 @ 50.05” while the best ask is 50.02 and your order is marketable — it crosses and executes immediately against the resting asks (at 50.02, not 50.05 — you set a ceiling, not the price). So the same order is maker or taker depending on where you price it: rest inside/away from the spread → maker; price across the book → taker.
Orders can also partially fill: take 2,000 but only 1,500 available at acceptable prices → you get 1,500; the rest rests (limit) or cancels. Real fills are often a messy sequence of partials.
Source: Larry Harris, Trading and Exchanges, ch.5–6 (order types, the book, precedence rules). For a live feel, the SEC market-structure primers on order types are short and concrete.