Skip to main content
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.

Quiz · 1 question ↓

Better price first, then earliest arrival

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.

Bids, asks, and market depth

Book sideWhat you seeWhat it means
BidsList of buy orders, highest price at topHow many shares people will pay UP TO each price
Asks (offers)List of sell orders, lowest price at topHow many shares people will sell DOWN TO each price
Top of bookThe best bid + best ask on this bookAcross every venue, the best of these is the National Best Bid and Offer (NBBO) — the headline quote on a broker's trading screen
DepthSizes available at the next several price levelsHow far the price moves if a large order eats through layers

The 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.

Displayed 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.

Compare 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.

Which order fills first?

Two traders submit a buy order for 100 shares at $50.00. Trader A's order reaches the exchange at 10:00:00.001. Trader B's order reaches at 10:00:00.002. A seller hits both sides with 100 shares at $50.00. Whose order fills first under price-time priority?

Show the answer

Answer: A. Trader A -- same price, earlier timestamp wins

Price-time priority is the standard matching rule on US equity exchanges, applied in that order. Better prices execute first; among displayed orders at the same price, the earliest arrival wins. Both traders bid $50.00, so price cannot break the tie — and Trader A's order reached the exchange at 10:00:00.001, one millisecond before Trader B's. Trader A fills. Order size, the broker that sent it and whether the account is retail or institutional do not buy priority. The strongest distractor is the even split, because splitting a contested fill feels like the fair outcome and some markets in other asset classes really do use pro-rata allocation. US equity exchanges generally do not. The fairness here comes from the rule being impersonal and mechanical, not from dividing the proceeds. The rotation answer imagines an exchange exercising discretion. There is no discretion in the matching engine — that is the entire design. Takeaway: an exchange matches orders by rule, not by judgment. Knowing the rule explains why an order identical to yours filled and yours did not, and why being early at the same price is worth something.

The 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?

Why:
Continue this lesson in the app →See it on a real ticker →