Skip to content
All library documents

How Matching Engines Fill Large Marketable Orders

Article Quant Q&A · Author: Bobbi Bennett

Summary

The document explains how an incoming order that is large relative to the visible book interacts with resting orders. A market order generally consumes available liquidity across price levels until its requested size is filled or no executable liquidity remains. A marketable limit order can take available bids only down to its limit; any unfilled remainder may rest on the book, be cancelled, or be handled through routing, depending on its instructions and venue.

The answers describe matching engines as processing orders sequentially, settling the effects of an incoming order before processing the next one for that instrument. That means other incoming orders generally cannot interleave with the fills of a single marketable order, though a partially unfilled limit order can later interact with new orders once it is resting. The explanation is a useful mental model, but it emphasizes that details vary by exchange and order instructions; it is not a universal specification of every venue’s matching rules.

Key ideas

  • A market order can sweep multiple price levels to consume available opposite-side liquidity.
  • A limit order executes only at its limit price or better, and its remainder may rest or be cancelled.
  • Matching engines commonly process an incoming order before moving to subsequent orders for the instrument.
  • New orders generally interact with a resting remainder after the initial matching process completes.
  • Specific matching and routing behavior depends on venue rules and order instructions.

Tags

Full text
# How does order fulfillment proceed with larger orders?


# How does order fulfillment proceed with larger orders?












If a large sell order hits many bids from the book, is the order filled at once? Or is it filled one bid at a time with a chance for any new orders to come in between each trade?

## Answer by Steve Severance (score 5, accepted)

https://quant.stackexchange.com/a/1335

Most exchanges will cross a large order with numerous smaller orders so long as the large order sufficiently crosses the book to cause a fill. This is obviously dependent on specific instructions on the large order causing the cross as well as the orders on the other side of the book.

As for the second part a new order coming in should only cross with the large order if it offers price improvement over other orders in the book as they will have time priority. A single large order will sweep the other side of the book to fill and this typically happens in a single atomic step although I don't believe that there is any requirement to do so.

This is all exchange dependent. Check out Trading and Exchanges or Algorithmic Trading and DMA as both these books cover crossing mechanics in considerable detail.

## Answer by Ted Graham (score 5)

https://quant.stackexchange.com/a/1336

It depends if the large incoming sell order is a market order or a limit order.

If it is a market order, it will immediately "sweep" through as many levels of the bid book as neccessary to get the required volume. There is no chance for someone to add more bids to execute against the market order.

A limit order will execute against all the bid volume that it can without selling below the limit price. Then the remaining volume will go resting in the book, at which point there is a chance for new buyers to come in and execute against it.

## Answer by NPE (score 2)

https://quant.stackexchange.com/a/1338

Here is a good mental model. The exchange's matching engine processes incoming orders one at a time: all effects of an order on the book are settled before any further incoming orders for the same instrument are looked at.

So, when a marketable order comes in, it is matched against resting orders "atomically", producing one or more fills. If this completely fills the incoming order, that's it. If some part of the order could not be matched, the remainder is either placed on the book or cancelled (or in some cases routed to a different exchange). Any subsequent incoming orders wait their turn until all of this is done.

With many modern matching engines all of this happens very quickly: for example, BATS claim an average order matching latency of 200 microseconds. I understand this even includes a network roundtrip.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.