hedgefund.wiki — institutional knowledge base

Matching Algorithm

Market Microstructure · intermediate · CC-BY-4.0

A matching algorithm is the set of rules and procedures used by a trading venue to determine which buy and sell orders should be paired together for execution and at what price, given all available orders in the order book at any given moment. The choice of matching algorithm profoundly affects price discovery, liquidity distribution, and the fairness of order execution across different participant types.

Key takeaways

Explanation

The matching algorithm is the operational heart of any trading venue, determining which orders interact and how the gains from trade are distributed among participants. Far from a mere technical detail, the choice of matching algorithm shapes the incentives of every participant in the market, influencing strategies ranging from high-frequency market making to institutional block trading.

The price-time priority algorithm (also called first-in, first-out or FIFO) is the most widely used mechanism in equity markets. Under FIFO, orders are matched in order of price priority first: all orders at the best price must be exhausted before orders at inferior prices receive fills. Among orders at the same price level, time of arrival is the tiebreaker — the order submitted earliest receives the next fill. This algorithm strongly rewards speed, creating the arms race in low-latency infrastructure that characterizes modern equity market making.

Pro-rata matching, by contrast, allocates fills among all orders at the best price proportionally to their size, rather than rewarding the first to arrive. This algorithm is commonly used in U.S. Treasury futures markets on CME and in some options markets. Pro-rata rewards participants for showing size, encouraging large-scale market making but also incentivizing 'order padding' — submitting oversized orders with the expectation of receiving a proportionally smaller fill. The result is typically an inflated order book where the true committed liquidity is a fraction of the displayed volume.

Auction matching algorithms operate on different principles from continuous trading. During an opening or closing auction, the venue collects all orders submitted during the pre-auction period and then determines the single price that maximizes the volume of tradeable orders — the maximum execution price, or MEP. All matchable orders execute at this single price, ensuring that early and late auction participants receive identical prices, and that the price-discovery function of the auction is maximized.

For algorithmic traders and market structure professionals, understanding the specific matching algorithm used by each venue is essential for strategy design. A FIFO venue rewards co-location and low-latency execution; a pro-rata venue rewards size and market-making commitment. Execution algorithms must be tuned to exploit the specific incentive structures created by each venue's matching rules.

Formula

Pro-rata Fill = (Order Size / Total Resting Size at Price) × Available Quantity

Example

CME Group's Eurodollar futures (now SOFR futures) markets use a 'top order + pro-rata' matching algorithm. The first order submitted at the best price receives a 'top order' priority and is filled ahead of pro-rata allocation. After the top order is filled, remaining orders at the best price level share remaining fills in proportion to their size. A participant submitting a 1,000-lot order when 10,000 total lots are resting at the best price (500 top order + 9,500 others) would receive: their top order (if submitted first) plus approximately 1,000/10,000 = 10% of remaining fills. This design incentivizes both speed (for top order priority) and size (for larger pro-rata allocation).

Related terms

Co Location Dark Liquidity Equity Eurodollar Exchange Latency Liquidity Market Impact Order Book Price Discovery Speed Swap Execution Facility