⚠ Trading involves significant risk of loss. Everything on this site is for education only and is not financial advice.
Lesson 5 of 12 · Free

How orders are matched: price-time priority and auctions

Learn how a matching engine ranks orders in continuous trading and how an auction finds a single price that maximises traded volume.

Author: Moustafa HijaziContent reviewed: 2026-10-305 min readSelf-study course

What you will learn

  • How price-time priority decides which resting order trades first.
  • At which price an incoming order trades, and when it gets price improvement.
  • How pro-rata allocation differs from time priority.
  • How to calculate an auction price step by step from a list of orders.

Explanation

A matching engine is the venue software that matches incoming and resting orders under fixed, published rules. Auction schedules were covered in the course "Stocks" and return in lesson 8; here we look at the calculation.

Continuous trading: price-time priority

Under price-time priority, the engine ranks resting orders:

  1. Price first: a higher bid ranks before a lower bid; a lower ask ranks before a higher ask.
  2. Time second: at the same price, the order that arrived earlier trades first. This is your place in the queue.

On Xetra, market orders rank ahead of limit orders. Changing an order's price or increasing its size usually gives it a new timestamp; reducing the size usually does not.

Which price?

A trade in continuous trading takes place at the price of the resting order. If you send a buy limit at €20.03 and the best ask is €20.02, you buy at €20.02, one cent better than your limit. This is price improvement compared with your limit.

In a partial fill, the untraded rest stays in the book or is cancelled, depending on time-in-force.

Pro-rata allocation

Some futures markets, mainly for certain interest-rate contracts, use pro-rata allocation instead: an incoming order is split among all resting orders at the best price in proportion to their size. Size matters more than speed; some venues combine both methods.

Auctions

In an auction, orders are collected during a call phase without trading. The venue usually shows an indicative price. On Xetra, the call phase ends at a random moment within a short period, so nobody can place a last-second order with certainty. Then the engine determines one single price at which all executed orders trade (uncrossing).

The Xetra rules, in order:

  1. Choose the price with the highest executable volume.
  2. If several prices tie, choose the one with the lowest surplus (unmatched volume at that price).
  3. If they still tie: if the surplus is on the buy side at all of them, take the highest price; if it is on the sell side at all, take the lowest.
  4. Otherwise the reference price (last traded price) decides: if it is at or above the highest candidate, use the highest; at or below the lowest, use the lowest; in between, use the reference price.

For each candidate price, demand = market buy orders + buy limits at or above that price; supply = market sell orders + sell limits at or below it. Executable volume = the smaller of the two.

Worked example

Hypothetical example 1 (continuous): two asks rest at €20.02: order A, 300 shares (entered first), and order B, 500 shares. You send a buy limit at €20.03 for 600 shares. Result: 300 from A at €20.02, then 300 from B at €20.02. B keeps 200 shares in the book. Price improvement: €0.01 × 600 = €6.00 compared with your limit.

Pro-rata: resting orders of 600 and 400 shares at the best price, incoming order 500: 500 × 600/1,000 = 300 and 500 × 400/1,000 = 200.

Hypothetical example 2 (auction): market buy 100, market sell 100, plus these limits.

Price Buy limits Sell limits Demand Supply Executable Surplus
€10.05 300 500 400 1,800 400 1,400 sell
€10.04 200 400 600 1,300 600 700 sell
€10.03 400 300 1,000 900 900 100 buy
€10.02 300 300 1,300 600 600 700 buy
€10.01 500 200 1,800 300 300 1,500 buy

Check at €10.03: demand = 100 + 300 + 200 + 400 = 1,000; supply = 100 + 200 + 300 + 300 = 900. The highest executable volume, 900 shares, is reached only at €10.03, so the auction price is €10.03. All 900 shares trade at €10.03, even for buyers whose limit was €10.05. The buy limits at €10.03 receive only 300 of their 400 shares. Exclusions: fees.

Common mistake

Believing you pay your own limit in an auctionEveryone executed in an auction pays the single auction price, not their own limit. But a far-away limit means you accept any price up to it, so a surprise auction price can still hurt. Set only a limit you would truly accept.

Practice activity

Hypothetical auction with no market orders. Buy limits: €5.10 × 400, €5.09 × 300, €5.08 × 500, €5.07 × 600. Sell limits: €5.07 × 300, €5.08 × 400, €5.09 × 500, €5.10 × 600. The reference price is €5.12.

  1. Calculate demand, supply, executable volume and surplus at each price.
  2. Determine the auction price using the rules above.
Show solution

1. €5.10: demand 400, supply 1,800, executable 400, surplus 1,400 sell. €5.09: demand 700, supply 1,200, executable 700, surplus 500 sell. €5.08: demand 1,200, supply 700, executable 700, surplus 500 buy. €5.07: demand 1,800, supply 300, executable 300, surplus 1,500 buy.

2. Highest executable volume: 700 at both €5.08 and €5.09. Surplus is 500 at both, so rule 2 does not decide. The surplus is on the buy side at €5.08 and the sell side at €5.09 (mixed), so rule 3 does not decide either. The reference price €5.12 is above the highest candidate, so the auction price is €5.09.

Limitations: these are the Xetra rules in simplified form; other venues use similar but not identical rules.

Key takeaways

  • Continuous trading ranks orders by price first and time second; trades happen at the resting order's price.
  • Pro-rata allocation rewards size instead of speed and is used in some futures markets.
  • An auction picks the price with maximum executable volume, then minimum surplus, then the tie-break rules.
  • Everyone executed in an auction trades at the same price.

Next step

The next lesson turns to the cost of execution: slippage and market impact, with worked numbers.

Self-check

Answer the questions, then check your answers. You can retry as often as you like.

1. Three bids rest at €30.00: X (200 shares, 09:01), Y (500 shares, 09:03), Z (300 shares, 09:02). A market sell of 400 shares arrives. How is it filled under price-time priority?

2. You send a buy limit order at €15.10. The best ask is €15.06 for 1,000 shares, and you buy 500. At which price do you trade in continuous trading?

3. In an auction, two prices both give the highest executable volume and the same surplus. The surplus is on the buy side at both. Which price is chosen under the Xetra rules?

Automatic self-check for your own revision. Your answers are checked in your browser and are not seen or assessed by us. It is not an exam and not a qualification.

Your progress

“Complete” only means you marked the lesson as done. It is not a test of your understanding. Progress and notes are saved only in this browser on this device — not in an account.