WhitmanTrading

What Is an Order Matching System?

Order matching system is the software at an exchange that pairs incoming orders with resting ones according to published priority rules, most commonly price first and then time of arrival. Those rules decide which participant gets filled, so the design of the engine is a material part of how a market behaves.

Somewhere behind every trade is a program deciding which two orders meet. The rules it follows are published, unglamorous, and they determine who gets filled at a price and who watches.

How it works

A price series with two orders being paired.
A matching system pairs orders with each other. Illustrative chart - not real market data.

Resting orders wait in the order book, sorted by price. An incoming order is checked against the best price on the opposite side.

A steady series where the best price is matched first.
Price first, then usually time of arrival. Illustrative chart - not real market data.

Better prices always match first. That part is universal — no venue fills a worse price ahead of a better one.

A rising series where earlier orders fill first at one price.
So being early at a price is worth real money. Illustrative chart - not real market data.

At the same price, the tiebreak varies. The most common rule is time — first in, first filled — which makes arrival order a genuine economic asset.

A falling series where orders are filled proportionally.
Some venues use pro-rata instead. Illustrative chart - not real market data.

The tiebreak decides the market’s character

A choppy series where allocation rules change order sizing.
Which changes what order sizes make sense. Illustrative chart - not real market data.

Under price-time priority, speed is the edge. Being microseconds earlier at a price gets a full fill where a later identical order gets nothing.

A slow series where the rule shapes behaviour over time.
And different again over a long horizon. Illustrative chart - not real market data.

Under pro-rata, size is the edge. Incoming volume is split across resting orders in proportion to their quantity, so posting more gets you more — which creates an incentive to quote larger than you want.

A calm series where matching is unremarkable.
A quiet stretch hides what it measures. Illustrative chart - not real market data.

Neither is neutral. One venue rewards infrastructure, the other rewards balance sheet, and the choice shapes which participants find it worth quoting there.

A worked example

Four buyers rest at 99.95: you with 500, then three others with 1,000, 2,000 and 500, in that arrival order. A seller arrives with 1,000.

Under price-time priority: your 500 fills completely because you were first, and 500 of the next order fills. The last two get nothing.

A falling series with a stop level marked.
A stop fills where the market is. Illustrative chart - not real market data.

Under pro-rata: the 1,000 is split across all four in proportion to their sizes. You hold 500 of the 4,000 total, so you receive about 125 — a quarter of what the time rule gave you, for the identical order.

Same order, same price, same moment, four times the difference. Nothing about your decision changed; only the rulebook did.

Where the engine also sets the price

At the open and close, most venues run an auction instead. Orders accumulate without matching, and a single price is calculated that trades the maximum possible volume — which is market clearing performed explicitly rather than continuously.

That auction price is often the day’s most important print. Index funds, settlement prices and many benchmarks reference it, and far more volume trades in those few seconds than in any ordinary minute.

And the rules there differ again. Auction matching has its own priority scheme, its own order types that only exist during the auction, and its own published imbalance information.

Which is worth knowing simply because it explains the shape of a trading day. The volume spikes at the open and close are not sentiment; they are the mechanism, and a strategy that trades into them is trading against a different process than the one operating at midday.

The original data

On this site’s shared series a round trip costs 0.0098, about 2% of the median bar range of 0.493. Direction runs average 2.01 bars with a longest of 11.

Queue position is what decides whether you earn that spread or pay it. A resting order that fills is collecting the 0.0098; an order that never reaches the front of the queue ends up crossing and paying it.

A candlestick chart annotated with the cost of a round trip.
A round trip costs a share of a bar. Illustrative chart - not real market data.

And the engine operates far below the resolution of any chart. The ninetieth percentile bar of 1.101 covers a period in which a matching engine has processed an enormous number of decisions, none of which appear in the bar.

A price series with volume shown beneath.
Volume and price measure different things. Illustrative chart - not real market data.

What it does not decide

It does not set the price. It discovers it, by matching whatever orders arrive — the engine has no view, no model, and no opinion about value.

It does not guarantee a trade. If nobody is resting on the other side, an order simply waits or is rejected, and no software can manufacture a counterparty.

And it does not clear the trade. Matching says who traded with whom; settlement and the management of counterparty risk are entirely separate systems that run afterwards.

Which is a distinction worth holding onto. Almost every failure that gets described as an exchange problem is a clearing, settlement or connectivity problem, and the matching engine itself is one of the more reliable pieces of software in the financial system.

It also does not decide what you see. The market data feed is a separate product from the matching engine, published at its own speed, so the book on your screen is always a slightly older version of the one the engine is working from. Every decision made from a screen is made from a photograph of a state that has already moved on.

When it fails

The characteristic failure is assuming a touched price means a fill. A trader watches the price trade at their limit level, sees no execution, and concludes something went wrong with their broker. Nothing went wrong. Their order was behind others in the queue at that price, the incoming volume was exhausted before reaching them, and the trade they saw on the tape was somebody else’s. The price being available and the price being available to you are two different facts, and only the first one is visible on a chart.

A candlestick series with a gap through a level.
A gap skips the level entirely. Illustrative chart - not real market data.

A second failure is assuming every venue uses the same rules. Price-time and pro-rata coexist, often within the same asset class.

A third is modifying a resting order casually. At most venues, changing the size upward or the price loses your place in the queue entirely.

A fourth is treating matching as settlement. The trade is agreed at matching and completed days later.

A declining series cut short at a decision point.
It traded at your price. Why no fill? Illustrative chart - not real market data.

And a fifth is ignoring the auctions. The open and close run a different mechanism, and a large share of daily volume happens inside them.

Order book covers the structure the engine matches against. Market clearing covers the price that balances supply and demand. And order flow covers what arrives at the engine and what it reveals.

What I actually do

Two people can place the same order at the same price and get completely different outcomes, and the reason is a rulebook neither of them has read. The matching rules are public, boring, and they decide more about your fill than your analysis does.

— Michael Whitman

This page is educational, not financial advice. Test every idea on your own charts before risking money.