The intuition: a queue at every price
Imagine a market stall where sellers write the lowest price they will accept on cards and buyers write the highest price they will pay. Sellers stack their cards from cheapest upward. Buyers stack theirs from most generous downward. Nothing happens until someone is willing to cross the gap and trade with the best card on the other side.
That is an order book. It is the electronic list, kept by an exchange or trading venue, of all the limit orders currently waiting to trade. A limit order states a price and a quantity, and it rests in the book until it is matched, cancelled or expires.
This lesson covers four things: how to read the book, how orders are matched, how a large order moves the price, and what the book cannot tell you.
The mechanics: bids, asks and depth
The book has two sides:
- Bids are buy orders. The best bid is the highest price a buyer is currently willing to pay.
- Asks (also called offers) are sell orders. The best ask is the lowest price a seller is currently willing to accept.
The best bid is always below the best ask. If a bid met or exceeded an ask, the two would trade immediately. The difference between them is the bid-ask spread, and the midpoint is often used as a rough reference price. (For the cost side of the spread, see our lesson on the bid-ask spread.)
Market depth is the quantity waiting at each price level, and in particular how it builds up as you move away from the best prices. A book with large quantities at many nearby prices is "deep". A book with small quantities and big gaps between prices is "thin". Depth is one of the main ways liquidity shows up in practice.
A hypothetical order book
The numbers below are round and invented for teaching. They are not a real market. Prices are in a neutral currency unit, quantities in shares.
| Side | Price | Quantity |
|---|---|---|
| Ask | 100.40 | 500 |
| Ask | 100.30 | 800 |
| Ask | 100.20 | 1,200 |
| Ask | 100.10 | 600 |
| Spread | 0.10 | |
| Bid | 100.00 | 700 |
| Bid | 99.90 | 1,000 |
| Bid | 99.80 | 1,500 |
| Bid | 99.70 | 2,000 |
Reading it:
- Best bid is 100.00 and best ask is 100.10.
- The spread is 0.10, and the midpoint is 100.05.
- Only 600 shares are offered at the best ask. A buyer wanting more than that must go to higher prices.
- Total quantity offered within 0.30 of the best ask (100.10 to 100.40) is 3,100 shares. Total bid quantity within 0.30 of the best bid (100.00 to 99.70) is 5,200 shares. On this snapshot, buyers are queued more heavily than sellers. That says something about visible intentions, but not necessarily about where the price will go next, as the last section explains.
Price-time priority: who trades first
Most electronic order books match orders using price-time priority:
- Price first. A higher bid beats a lower bid. A lower ask beats a higher ask.
- Time second. Among orders at the same price, the one that arrived earlier is filled first.
Suppose the 600 shares at 100.10 are made up of three sellers who arrived in this order:
- Seller A: 200 shares
- Seller B: 300 shares
- Seller C: 100 shares
A buyer sends a market order for 250 shares. Seller A is filled completely (200 shares), then Seller B is filled for the remaining 50. Seller C has not traded and is still waiting, and Seller B has 250 shares left, now at the front of the queue.
This is why a trader who wants to be filled with a limit order cares about queue position. Joining a price level late means waiting behind everyone already there. It is also why changing the quantity or price of an order can cost you your place, depending on the venue's rules.
Not every venue works this way. Some use pro-rata allocation or other rules for certain products, and opening and closing auctions use their own matching methods. Check the rules of the venue you use.
Worked example: a large market order walks the book
A market order says "trade now at whatever prices are available". It does not specify a price, so it consumes the book from the best price outward. This is called walking the book.
Using the hypothetical book above, a buyer sends a market order for 2,000 shares.
Step 1. Take all 600 shares at 100.10. Cost: 600 × 100.10 = 60,060
Step 2. Still need 1,400. Take all 1,200 shares at 100.20. Cost: 1,200 × 100.20 = 120,240
Step 3. Still need 200. Take 200 of the 800 shares at 100.30. Cost: 200 × 100.30 = 20,060
Total cost: 60,060 + 120,240 + 20,060 = 200,360
Average price: 200,360 ÷ 2,000 = 100.18
Compare that with the reference points:
- The quoted best ask was 100.10, so the buyer paid 0.08 per share more on average than the headline price.
- Against the midpoint of 100.05, the extra cost is 0.13 per share, or about 260 in total across 2,000 shares.
- The last trade printed at 100.30, and the new best ask is also 100.30, now with 600 shares remaining. The best bid is still 100.00, so the spread has widened from 0.10 to 0.30 until new orders arrive.
The difference between the price you expected and the average price you got is slippage (also called market impact when it is caused by your own order). In deep books it is small. In thin books it can be large.
The same logic works in reverse. A market sell for 2,500 shares would take 700 at 100.00, 1,000 at 99.90 and 800 at 99.80. The average price would be about 99.90, below the best bid of 100.00.
How a limit order changes the outcome
The buyer could instead send a limit order to buy 2,000 shares at 100.20 or better. It would trade 600 at 100.10 and 1,200 at 100.20, then rest the remaining 200 shares as a new bid at 100.20 rather than paying 100.30. The trade-off is certainty: the price is controlled, but the full quantity may not be filled. Our lesson on market orders versus limit orders covers this choice in more detail.
What depth does and does not tell you
It is tempting to treat the book as a forecast: more bids than asks means the price will rise. That is too simple. Displayed depth has real limits.
- Orders can be cancelled. Resting orders are not commitments. A large bid can vanish in a moment, often just as the price approaches it. Depth you see now may not be there when you trade.
- Hidden and iceberg orders. Some venues allow orders where only a small part is displayed, or none at all. The true quantity available may be larger than what is shown.
- Fragmentation. The same asset may trade on several venues, each with its own book. One book shows only part of the total liquidity. Many markets also have rules that route orders to the best available price across venues, but these differ by region.
- Manipulative quoting. Placing orders with no intention of trading, in order to mislead others, is often called spoofing. It is prohibited by regulators in many jurisdictions, but it shows why a snapshot of the book should not be taken at face value.
- Speed. Automated participants update quotes in fractions of a second. A book screenshot is a moment in time.
- Depth is not direction. A heavy bid side may reflect patient buyers, a market maker managing inventory, or a temporary imbalance. None of these reliably predicts the next price move.
The most dependable use of depth is practical rather than predictive: estimating how costly it would be to trade a given size right now.
Common mistakes
- Treating the best price as the price you will get. The quoted price applies only to the quantity displayed at that level. Larger orders pay more, as the worked example shows.
- Sending large market orders into thin books. Illiquid assets, wide spreads and outside normal trading hours all increase slippage.
- Assuming displayed orders are firm. Cancellation is cheap and common, so depth can disappear quickly in fast markets.
- Reading imbalance as a signal. More visible bids than asks is a description of the queue, not a reliable forecast.
- Ignoring queue position. A limit order at the best price may sit behind many others and may never fill if the price moves away.
- Looking at one venue only. Depth on a single book can understate or overstate what is actually available.
Try this
Using the hypothetical book in this lesson:
- A buyer sends a market order for 1,500 shares. Walk the book level by level and work out the total cost and the average price. (Hint: 600 at 100.10, then 900 more, which must come from 100.20 where only 1,200 are offered.)
- Calculate the slippage of that average price against the midpoint of 100.05.
- Now suppose the 1,200 shares at 100.20 are cancelled just before the order arrives. Recalculate the average price. How much did the cancellation cost the buyer?
- Finally, open the order book display of any trading platform you have access to (a demo or watch-only view is enough). Pick a liquid asset and a less liquid one, and compare the spread and the quantity within a few price levels of the best bid and ask. Do not trade. Simply note how the shape of depth differs.
The point of the exercise is to build the habit of asking not just "what is the price?" but "what is the price for my size?"