Section 02 · The Book
Matching Rules
Price first, then time. Simple to state, and it determines who trades.

Price first, then time. A numbered queue is the second half of that rule made visible.
Photo: Rangoni Gianluca / Pexels§ 01The basic hierarchy
Every exchange that operates an order book has a matching engine at its core: software that takes incoming orders and decides which of them execute against each other. The rules it uses are not arbitrary. They are published, consistent, and almost universally shared across modern equity and futures markets. Understanding them means understanding who gets filled and who waits.
The first rule is price priority. A buyer willing to pay more is always ahead of a buyer willing to pay less; a seller willing to accept less is always ahead of a seller willing to accept more. This follows from the logic of the market itself — the person making the most aggressive offer is the one most deserving of a trade. When a new sell order arrives, the matching engine scans the bid side for the highest price first. If a buyer is there at that price or better, a trade results. The seller does not get to choose which buyer; the engine chooses by rule.

Price in one column, quantity in the next. The two answer different questions and were kept apart long before either was electronic.
Photo: Matvei / PexelsPrice priority settles most ambiguity, but it does not settle all of it. Two buyers can both be willing to pay exactly the same amount. The second rule breaks that tie: time priority, sometimes called first-in, first-out. Between two orders at identical prices, the one that arrived earlier is matched first. This is the reward for committing to a price early. It creates a practical incentive: if you want to be at the front of the queue, you must enter your order before others do. Sitting on the best bid and refreshing your price just before a seller arrives will not help — the engine gives a repriced order a new timestamp, so changing your price sends you to the back of the queue at the new level.
§ 02What this produces in practice
Together, price-time priority creates the order book as a ranked queue on each side. At any moment the book is sorted, automatically, with the most aggressive prices closest to the market and the least aggressive furthest away. Every new order either trades immediately — if it crosses the existing best price on the opposite side — or joins the queue at its stated price, behind everyone already there at the same level.
They are published, consistent, and almost universally shared across modern equity and futures markets.
The consequences are easier to see in a busy market than a quiet one. In a deep market with many participants at many price levels, the queue at the best price can be long, and a time-lagged participant may wait some time for a fill even though they are bidding the right price. This is why institutional orders are sometimes broken into pieces — entering a single large order at the best bid immediately places it behind all existing orders at that price, and the fill may be slow. Smaller, staggered submissions can manage queue position more deliberately.
A variation worth knowing is pro-rata allocation, which some derivative exchanges use as an alternative to pure time priority. Under pro-rata rules, when a sell order arrives at a given price, all buy orders at that price receive a share of the fill proportional to their size, regardless of when they arrived. The rationale is that a very large early order does not monopolise the fill. The practical effect is that participants submit larger orders than they actually want, hoping for a partial fill proportional to their inflated size. Pure price-time priority produces no such distortion, which is one reason equity markets have broadly stuck with it.

The same two columns, lit differently. Nothing about the mechanism changed when the room became a screen.
Photo: Phil Desforges / PexelsWhat these rules do not include is any consideration of who the participant is, how long they intend to hold the position, or what their reason for trading might be. The matching engine is indifferent to intention. It reads price, then time, and executes. This neutrality is foundational: every participant who enters a limit order at a given price has an equal claim on that position in the queue. The mechanism is impersonal by design, and that impersonality is what makes the published rules credible.
Lifted out of the flow · 01
How the queue works
| Term | What it is |
|---|---|
| Price priority | the most aggressive price on each side is always matched first |
| Time priority | between orders at the same price, the earlier arrival is matched first |
| Pro-rata allocation | a variation used on some derivatives markets; fills distributed by order size, not arrival time |
| Limit order | an order to buy or sell at a specified price; it joins the queue if no immediate match exists |
| Crossing the spread | when an incoming order's price meets or beats the best price on the opposite side, a trade executes |