Trading · Orders and execution
The order book: how bids, asks and one market order meet
A five-level order book worked through by hand: what each row means, who trades first at a price, and what one 1,000-share market order does to the price and spread.
On this page
Every stock exchange keeps a list of the orders that are waiting to trade. Buyers who named a price below what anyone will sell for, and sellers who named a price above what anyone will pay, sit on that list until someone meets them or they cancel. The list is the order book, and the price you see on a quote screen is just its top line.
Reading a book is a matter of five ideas: bids, asks, size, priority and what happens when an order arrives that can trade right away. This lesson takes them one at a time with one small book, then walks a single market order through it and measures what the order cost compared with the price on the screen.
Bids, asks and size
A book has two sides. The bid side holds buy orders, sorted with the highest price on top, because that is the buyer most willing to pay. The ask side (also called the offer) holds sell orders, sorted with the lowest price on top. Each row is a price level and the total number of shares waiting there.
Here is the book used in this lesson. It is invented, but the shape is typical of a liquid $50 stock: a two-cent spread and a few hundred to a few thousand shares at each price.
| Side | Price | Shares |
|---|---|---|
| Ask | $50.10 | 1,200 |
| Ask | $50.08 | 800 |
| Ask | $50.07 | 400 |
| Ask | $50.06 | 500 |
| Ask | $50.05 | 300 |
| Bid | $50.03 | 400 |
| Bid | $50.02 | 600 |
| Bid | $50.01 | 900 |
| Bid | $50.00 | 1,500 |
| Bid | $49.98 | 700 |
The top of each side is the quote: bid $50.03 for 400, ask $50.05 for 300. The spread is $0.02, and the midpoint is $50.04. A quote screen that shows only these two numbers is showing one row of each side; the rows beneath are the book's depth. Here the five ask levels hold 3,200 shares, worth about $160,000, and the five bid levels hold 4,100.
Notice that the book has gaps. Nobody is selling at $50.09 and nobody is buying at $49.99. Gaps are normal, and they matter: an order that eats through a level jumps straight to the next one that exists.
Why the orders sit there
Everything in the book is a limit order: an instruction to buy at a stated price or lower, or sell at a stated price or higher. A limit order that cannot trade when it arrives joins the book and waits. That is the only way an order gets into the book.
A market order never waits. It says "trade now at the best price available", so it trades against whatever is in the book at that moment and is gone. The same is true of a limit order priced at or through the other side (a buy limit at $50.06 when the ask is $50.05). Traders call these orders marketable: they take liquidity from the book. Resting limit orders provide it. The difference shows up in fees, too. Many exchanges pay a small rebate to the order that rested and charge the one that took it, the maker-taker model in Maker-taker fees.
Who trades first at one price
Several orders often rest at the same price. When a seller arrives, which buyer gets the shares? Each exchange's rulebook answers that, and the answer is called priority.
On Nasdaq, Rule 4757 ranks orders by price, then by whether they are displayed (an order that shows its size beats one that hides it at the same price), then by time of entry. The first displayed order at the best price is first in line.
In the example, three bids rest at $50.03 for 100, 200 and 100 shares, entered in that order. A market sell order for 250 shares arrives. Order A, the oldest, fills completely. Order B gets 150 of its 200 shares and stays in the book with 50, now first in line. Order C gets nothing. If you placed order C, the price traded at your limit and you still did not buy. That is queue position, and it is why "the stock touched my price" does not mean "my order should have filled".
NYSE is a little different. Rule 7.36 ranks by price, then by a priority category (displayed orders ahead of non-displayed ones), then time. But Rule 7.37 then shares an execution at the best price among participants: the designated market maker, each floor broker and the book as a whole each receive a part, on parity, before time priority applies within the book. The effect is that a small order resting on NYSE can fill earlier than a strict time queue would suggest.
Hidden and reserve orders also live at a price. A reserve order (often called an iceberg) shows a small part of its size and refills the displayed part as it trades. On Nasdaq the hidden part ranks behind every displayed order at that price, which is the price a trader pays for not showing size. The glossary entry Iceberg order has the details.
Walk one order through the book
Now the main event. A trader sends a market order to buy 1,000 shares. The best ask holds only 300. The order takes those, then moves to the next level, and keeps going until 1,000 shares are filled.
The order also changed the book. The $50.05 and $50.06 levels are gone and $50.07 has 200 shares left. The new quote is bid $50.03, ask $50.07: the spread has doubled to four cents and the midpoint has moved up a cent. The next buyer faces a worse price until someone sells into the gap or a market maker requotes. This is the mechanism behind market impact: buying moves the price up because it removes the cheapest sellers.
Size changes the result sharply. With the same book:
| Market buy | Average price | Above the midpoint | New best ask |
|---|---|---|---|
| 200 | $50.050 | 1.0 ¢ | $50.05 |
| 500 | $50.054 | 1.4 ¢ | $50.06 |
| 1,000 | $50.059 | 1.9 ¢ | $50.07 |
| 2,000 | $50.0685 | 2.85 ¢ | $50.10 |
The first 300 shares cost the quoted price. After that, each extra block costs more than the one before, because it is reaching further into the book. That is why a cost estimate built only on the spread understates the cost of large orders, as the lesson on Liquidity and slippage: volume, depth, spread and market impact measures with real data.
A limit order changes the picture. A buy limit at $50.06 for 1,000 shares would take the 300 at $50.05 and the 500 at $50.06, then stop: it is not allowed to pay $50.07. The remaining 200 shares would rest in the book as a new best bid at $50.06, and the spread would close to zero until someone sold to it. The trader controls the price but gives up the certainty of a full fill. Market vs limit orders: price certainty vs getting filled covers that trade-off.
An invented book of five levels a side on one venue, frozen while the order fills: no one else trades or cancels, no hidden or odd-lot orders, no fees. Real US orders are routed across many venues and protected against trading through a better displayed quote (Regulation NMS).
What the book does not show
A single exchange's book is not the whole market. A US stock trades on more than a dozen exchanges, in dark pools and with wholesalers that never post a book at all. The best bid and ask across all exchanges form the national best bid and offer (the NBBO), and the order protection rule stops an exchange from trading through a better price posted elsewhere. So the 1,000-share order in the example would in practice be routed across several venues, each with its own book. Order routing and best execution: NBBO, Rule 611, PFOF and 606 explains that path, and Dark pools: how off-exchange trading works and how much of it there is covers the venues that show nothing.
Some liquidity is invisible even on the exchange. Hidden and reserve orders, orders that peg to the midpoint, and market makers who requote as soon as a level is taken all mean the real supply at a price can be larger than the displayed number. The opposite happens too: displayed orders can be cancelled in milliseconds, before a slower order reaches them. Displayed depth is a snapshot, not a promise.
Finally, the book is thinnest when it matters most: at the open, around news and in small companies. A stock with a two-cent spread at noon can show a 30-cent spread and a few hundred shares at 9:30:01. The Opening and closing auctions: how the open and close are set lesson explains why so much volume waits for the opening and closing crosses instead.
Reading a real book
Most brokers sell or include a depth screen, usually called Level 2. It shows the book just like the tables above, often with the venue of each order. Three habits make it useful:
- Look at size, not just price. A $0.01 spread with 100 shares on the ask is not the same market as a $0.01 spread with 5,000. Compare the size near the top with the order you intend to place.
- Look for gaps. Missing price levels mean a market order of modest size can jump several cents. That is common in stocks that trade fewer than a million shares a day.
- Watch the book change. Orders that appear and vanish, or a large bid that keeps moving up a cent ahead of the price, are information too, though it is easy to read too much into them. Level 2 and time and sales: reading depth and the tape goes further, alongside the record of trades.
How Finabase does it
Finabase does not show an order book or a bid and ask on the symbol page; it shows the last price, the day's range and volume, and extended-hours prices. The volume figures still say something about depth: a stock that trades millions of shares a day almost always has a deep book, and one that trades a few thousand usually does not. The comparison view puts two stocks' volume side by side.
The paper trading account at /trading takes market and limit orders and fills them at live prices, without walking a book. A paper market order for 1,000 shares fills at one price, so it will look cheaper than the same order would be in a real, thin market. Use the paper account to practise placing limit orders and deciding on a price; use the arithmetic in this lesson to estimate what the real fill would cost.
Frequently asked questions
What is an order book in trading?
It is a venue's list of resting limit orders for one security: buy orders (bids) from the highest price down and sell orders (asks) from the lowest price up, with the number of shares at each price. Incoming orders that can trade are matched against it.
Why didn't my limit order fill when the price touched my limit?
Other orders at the same price were ahead of yours in the queue. Exchanges fill orders at one price in a set order, usually displayed orders first and then by time of entry, so the shares that traded at your price may have gone to earlier orders.
What does it mean to walk the book?
A marketable order larger than the best level takes all of it and continues to the next price levels until it is filled. Each level is worse than the last, so the average price is worse than the quote. In the example, 1,000 shares averaged $50.059 against a $50.05 ask.
Is the order book the same on every exchange?
No. Each exchange keeps its own book. The best prices across all of them form the national best bid and offer, and orders are routed among venues; some venues, such as dark pools, display no book at all.
Summary
- The order book is a list of waiting limit orders: bids on one side, asks on the other, with size at each price. The top line is the quote; the rest is depth.
- At one price, orders fill in a fixed sequence: price, then display, then time on Nasdaq, with a parity share for floor participants on NYSE.
- A market order larger than the top level walks the book. In the example a 1,000-share buy paid $9 more than the quote suggested and left the spread twice as wide.
- A limit order caps the price and may not fill; a market order fills and does not cap the price.
- Displayed depth is a snapshot. Hidden orders add to it, cancellations subtract from it, and other venues hold more.
Check your understanding
4 questions on this lesson. Each answer comes with the reason, and nothing is scored.
The best ask is $50.05 for 300 shares and the next level is $50.06 for 500. You send a market order to buy 600 shares. What is your average price?
- $50.050
- $50.055
- $50.060
Show the answer
B. $50.055 300 shares fill at $50.05 and the other 300 at $50.06: (300 × 50.05 + 300 × 50.06) ÷ 600 = $50.055.
Three buy orders rest at the same price on Nasdaq, all displayed. Which one trades first when a seller arrives?
- The largest one
- The one entered first
- They share the shares equally
Show the answer
B. The one entered first Nasdaq Rule 4757 ranks by price, then displayed before hidden, then time of entry. Among displayed orders at one price, the earliest fills first.
After a large market buy removes the two best ask levels, what usually happens to the spread?
- It widens, because the new best ask is further from the best bid
- It narrows, because buyers have been satisfied
- It is unchanged, because the bid side was not touched
Show the answer
A. It widens, because the new best ask is further from the best bid The bid stays where it was while the best ask moves up to the next remaining level, so the gap between them grows until someone posts new orders.
Why can a buy limit order at $50.06 not walk the book the way a market order does?
- Limit orders are only allowed to rest, never to trade immediately
- It can trade immediately, but only at $50.06 or lower; the unfilled rest waits in the book
- Exchanges fill limit orders only at the close
Show the answer
B. It can trade immediately, but only at $50.06 or lower; the unfilled rest waits in the book A marketable limit order trades against every level up to its limit, then the remainder becomes a resting bid at the limit price.
Sources and further reading
- Nasdaq Stock Market rulebook, Equity 4, Rule 4757 — book processing (price, display, time priority)
- NYSE rules 7.36 (order ranking and display) and 7.37 (order execution and routing; parity allocation)
- SEC, Investor.gov — Types of orders
- Finabase worked example — an illustrative five-level book; fills and averages computed in the Finabase figure script (scripts/learn/figures/trading-mechanics.ts)
