Not investment advice. Educational reading. See Disclaimer.
L.10 · BEGINNER · 4 MIN
Order Books and Price-Time Priority
Behind every trade is an order book — a live, two-sided list of every resting buy order (bids) and every resting sell order (asks) at the exchange. The matching engine — a piece of software running in milliseconds — pairs incoming orders against the book using a simple rule. Understanding that rule explains why your order fills, why someone else's identical-looking order fills first, and what the bid-ask spread is actually telling you about how easy this stock is to trade.
Price-time priority is the standard matching rule on US equity exchanges. Better-priced orders execute first. Among displayed orders at the same price, the earliest arrival usually executes first. (Some venues add wrinkles: hidden orders wait behind displayed ones, and NYSE shares fills among participants after the order that set the price.) Size, broker and customer type do not buy priority. The book is impersonal and ordered by rule.
§ 02Bids, asks, and market depth
Book side
What you see
What it means
Bids
List of buy orders, highest price at top
How many shares people will pay UP TO each price
Asks (offers)
List of sell orders, lowest price at top
How many shares people will sell DOWN TO each price
Top of book
The best bid + best ask on this book
Across every venue, the best of these is the National Best Bid and Offer (NBBO) — the headline quote on a broker's trading screen
Depth
Sizes available at the next several price levels
How far the price moves if a large order eats through layers
§ 03The spread as a liquidity gauge
The spread is a liquidity gauge, not a fee. A penny-wide spread on a mega-cap means dozens of market makers are competing to sit at the top of the book. A 40-cent spread on a thinly traded micro-cap means almost nobody is willing to quote tightly — if you need to trade now, you pay that gap. Spreads widen during stress, before earnings, and in the first and last few minutes of the session for predictable mechanical reasons.
§ 04Displayed vs hidden liquidity
Caution: Not every resting order shows up on the public book. An iceberg order displays a small slice (say 500 shares) while the rest sits hidden; as the visible slice fills, the engine refreshes it. Other order types are fully hidden until they execute. The practical takeaway: the visible book under-states real liquidity. A stock can absorb more size than the displayed depth suggests, especially in the largest names where institutional flow routinely uses hidden order types.
§ 05Compare spreads on a mega-cap and a thin stock
Work it out on paper. A mega-cap like MSFT usually trades with a one-cent spread; a thinly traded small-cap often shows 5-50 cents. A round trip of 1,000 shares costs about $10 in the first case and $50-500 in the second, before any commission. The spread is the round-trip cost of buying and immediately selling. Signed in? Compare the live bid and ask for MSFT and a thinly traded stock on their ticker pages.
§ 06Which order fills first?
§ 07The book as a picture of supply and demand
The order book is the truest picture of supply and demand at this instant. Price-time priority makes the matching engine fair AND fast — no human judgment, no negotiation, just first-in at the best price wins.
Quiz · 1 question
Check your understanding
Vantage Asset Management is trying to buy 200,000 shares of a mid-cap stock that shows a top-of-book ask of 800 shares at $42.10. The next price level on the book has 1,200 shares at $42.15, then 2,000 shares at $42.20. The trader sends a single market order for all 200,000 shares. What happens, and what does it teach about displayed vs real liquidity?