A matching engine is the software component of an electronic trading venue that pairs compatible buy and sell orders using an order book and predefined execution rules. Those rules determine which eligible orders trade, their execution sequence and allocated quantities. It is not the entire exchange or trading platform. The technology is used in securities, derivatives and cryptocurrency markets, although an individual implementation need not support multiple asset classes.
How Orders Become Trades
The order book records resting buy and sell orders and their remaining quantities. In continuous trading, an incoming buy limit order can trade against eligible sells priced at or below its limit; an incoming sell limit order can trade against eligible buys priced at or above its limit. Matching requires available opposing quantity, not identical original order sizes.
The matching engine compares an incoming order with eligible opposing orders, executes matches and reduces the remaining quantities. It then updates order and trade information. An order may fill completely, fill partly or receive no immediate fill. Any remainder rests in the book only if its order type and instructions allow it; otherwise, the applicable cancellation or expiry rules govern its treatment.
Under price-time priority, better-priced eligible orders take precedence: lower-priced sells for an incoming buy and higher-priced buys for an incoming sell. Among orders at the same price, earlier priority comes first. Each receives a fill up to its remaining quantity before the next order receives an allocation, so later orders may receive nothing.
Under pro rata allocation, executable quantity is generally shared among eligible resting orders at the same price in proportion to their remaining sizes. This is allocation based on resting quantity, not simply splitting a large incoming order among smaller ones. The applicable rules can differ by venue and product, so neither method should be assumed to apply universally.
Advertisement — FinchTrade.
FinchTrade services
Get startedExecution Prices and Liquidity
Eligibility, queue priority and execution price are separate questions. A matching engine applies the venue's rules to establish the trade price; a limit price is a boundary, not necessarily the price received. Some venues execute incoming orders at the resting order's price, allowing a buy to fill below its limit or a sell above its limit.
“Best available” pricing refers to eligible liquidity within the relevant venue or book, not a guarantee of the best price across markets. Rule-based matching supports orderly execution and contributes to price discovery through interactions between submitted bids and offers. It does not supply willing counterparties or ensure that an order will execute.
Performance and Post-Trade Boundaries
The matching engine automates order processing, reducing manual handling. Latency measures processing delay, while availability describes whether the service remains operational. Capacity and reliability matter when order traffic increases, and achieving performance and resilience involves implementation and ongoing maintenance costs. Automation does not eliminate software failures or operational mistakes, nor does speed guarantee a fill or a favorable trading result.
Matching produces an executed trade; clearing and settlement address the resulting obligations and their completion. Clearing establishes and processes obligations and may include netting, while settlement completes the required deliveries of assets or payments. Arrangements differ across venues and markets, so central-counterparty clearing should not be assumed. An execution record from a matching engine is not, by itself, confirmation of final ownership or funds transfer.