How exchange order matching works
- Author
- CRYPTO PORT Editorial
- Published
- Updated
- Reading time
- 5 min
In short
Matching is the process by which an exchange pairs resting buy and sell orders and turns them into trades. Most venues apply price priority first and time priority second, though the finer rules differ by operator. Understanding it explains why a limit order can sit unfilled.
Key points
- The core process that pairs resting orders into trades
- Price priority first, then time priority
- Market orders consume the book level by level
- Exact rules vary between operators
Definition
The exchange-side process that compares buy and sell orders in the order book under a fixed priority rule and confirms a trade whenever their conditions overlap.
An order book lists the price and size that buyers want and the price and size that sellers want. A program called the matching engine constantly compares both sides and confirms a trade the moment a bid price meets or exceeds an ask price. No human sits in between; it is all automated.
Priority starts with price. Higher bids and lower offers are handled first. When several orders share the same price, the one that arrived earlier goes first. This price-then-time rule is what most venues run on.
A market order names no price, so it eats into the book from the best side outward. If the size is large, the best price alone will not cover it and the order reaches into worse levels. That is one reason a fill can land away from the price you expected.
Details such as supported order types, time-in-force handling and self-trade prevention differ between operators. The same instruction can produce different results, so reading your venue's own specification once removes a lot of confusion.
Watch out for
- · A resting limit order only fills if the market actually reaches its price
- · In a thin book, a large market order can fill far from the top price
- · Order specifications differ by venue — check the operator's own documentation