An order matching algorithm is the set of rules a trading venue uses to pair executable buy and sell orders and decide how much each order receives. The matching engine applies those rules to a product. A trader’s own algorithm chooses what to submit, at what price, in what size and when.
Which Orders Can Trade?
In a continuous order book, an incoming order has just arrived and a resting order is already waiting to trade. Open quantity is the part that remains available. A fill is the amount that executes. An incoming buy first meets the lowest eligible offer. An incoming sell first meets the highest eligible bid. Executable quotes and trades provide information about supply and demand and contribute to price discovery.
Several sellers can quote the same price. The book tracks their open quantities and priority, and some quantity can be hidden. A buy limit caps the execution price and a sell limit sets a floor. A market order seeks to trade against available opposing prices. Once the engine reaches a price, the product’s order matching algorithms determine how sellers share the fill. Under first-in, first-out (FIFO), the earliest eligible priority timestamp goes first. A modification can reset that timestamp under venue rules.
One Buy Order, Two Possible Fills
Suppose A, B and C offer 20, 30 and 50 units respectively at a price of 100. A has the earliest priority timestamp and C the latest. A buyer submits a limit order for 40 units at 100. There are no better offers. All 100 units are displayed and eligible, and each result below is a whole unit.
With FIFO, A sells all 20 units and leaves the book. B sells 20 and has 10 open. C sells zero and keeps all 50 open. The buyer has all 40 units. If another buy arrives and the book has not changed, B is first in line at that price.
Under pure pro-rata, divide each seller’s eligible size by the 100 units available at that price, then multiply by the 40 units to match. A sells 8 and has 12 open. B sells 12 and has 18 open. C sells 20 and has 30 open. The two order matching algorithms leave 60 units for sale at the same price. Under FIFO only B and C still have units to sell. Under pure pro-rata all three sellers do.
Advertisement — FinchTrade.
FinchTrade services
Get startedHow Product Rules Change the Split
Actual order matching algorithms can allocate a trade in several steps. For certain CME products, a designated liquidity provider has an allocation entitlement. That means a specified share of the quantity available in a particular step. It does not let a worse price trade first. Eurex T7, by comparison, gives market-maker quotes no special priority. Quotes contribute available liquidity only while they are executable.
CME’s documented pro-rata step uses working displayed size for display-quantity orders. It rounds fractional lots down and can exclude an allocation below a configured minimum. A later FIFO step can distribute remaining lots. Consult the current product rules for displayed-size eligibility, allocation steps, minimums, rounding and residual distribution. The actual result can differ from the simplified example.
If an incoming order still has quantity to fill, it can meet interest at the next eligible price. A limit prevents a trade beyond its price boundary. Whether a remainder rests depends on the order conditions. Neither FIFO nor pro-rata guarantees a complete, immediate, or eventual fill, and a limit order can remain unexecuted. In a fast-moving securities market, a market order can execute at a different price from the last quote the investor saw.
An order rejected before allocation never reaches FIFO or pro-rata. Eurex describes a rare processing delay in which affected T7 products temporarily stop accepting new orders and the venue deletes non-persistent orders and quotes. The eligible quantity can change when trading resumes, so the earlier book snapshot may no longer describe what can trade.