Skip to content
All library documents

Limit Order Matching and Trade Prices in an Order Book

Article Quant Q&A · Author: DMin

Summary

The document explains how a trading venue can price a match when a buyer is willing to pay more than a resting seller’s limit price. In the described order-book model, one participant first posts a limit order and provides liquidity; a later marketable order from the other side consumes it. The trade executes at the resting limit order’s price, so the participant who arrived first sets the price rather than the venue splitting the difference or acting as principal.

The answer also outlines the trade-offs of providing liquidity. A provider can trade at a more favorable price than a liquidity consumer relative to the bid-ask spread, but exposes their trading interest and may face adverse selection. This is a concise general explanation, not a complete specification of every exchange’s matching rules; actual venues can have different priority and pricing rules.

Key ideas

  • In the described order-book model, a marketable order matches against a resting limit order.
  • The resting order’s price determines the execution price.
  • The liquidity provider sets a potential trade price and may benefit relative to a liquidity consumer on the spread.
  • Displayed interest can be exposed to adverse selection.
  • Matching priorities and pricing rules can vary across venues.

Tags

Full text
# In a mis-matched trade who profits?


# In a mis-matched trade who profits?












I am building a service similar to the BullionVault where users can buy and sell bullion. They will be placing their Buy and Sell orders on the service. Matched orders will get executed.

My question is this: When there is a matching buy and sell order, where, the selling price is significantly lower than the buy orders buying price, how should the price be determined?

These are the Options I could think of :

- Either the buyers price is taken or the sellers price is taken and one of them gets the benefit.

- The difference between prices is split in half and both of them benefit.

- The exchange buys from the seller and sells to the buyer in real time, so the difference is picked up by the exchange.

As this is similar to how the stock markets work, I am trying to understand how this type of a trade is executed in those exchanges.

## Answer by lehalle (score 4)

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

Your question is generic about matching engines, you should googlize about it or/and read a good book on market microstructure like Market Microstructure in Practice.

In short to answer to your question: the seller or the buyer came first in the market inserting a limit order, providing liquidity to other participants. Then came the other side with a marketable order, consuming liquidity. The outcome of a consumer matching a provider generates a trade at the price of the limit order.

It is about who came first in the market. When you provide liquidity, you

- set the price of a potential future trade,

- pay (the bid-ask spread) less than if you consume liquidity,

- disclose your interest,

- are exposed to adverse selection.

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.