What is a matching engine?

In short

A matching engine is the software in an exchange that keeps buy and sell orders in an order book and pairs them into trades by fixed rules, usually best price first and, at the same price, earliest order first. In the EU, Article 76 of the Markets in Crypto-Assets Regulation (MiCA) sets the rules for a crypto-asset trading platform.

Also called
Order matching engine, Trading engine, Central limit order book (CLOB)
Family
Crypto and trading
Facts checked

How a matching engine works

An incoming order is matched against the best price on the other side of the book and, at the same price, against the order that arrived first. That rule is price-time priority. The trade takes the price of the order already resting in the book, and what is left of a limit order rests there in turn.

Each match is a trade to book and settle, and the new prices and depth go out as market data. EU rules call this a continuous auction order book trading system: one that matches sell orders with buy orders at the best available price, continuously and without human intervention. The common order types and roles:

  • Limit order: buys or sells at a set price or better, and can rest in the book
  • Market order: trades at once against the best prices available
  • Stop order: waits for a trigger price, then becomes a market or limit order
  • Post-only order: a limit order that does not go through if it would trade at once
  • Maker and taker: the resting order adds liquidity, the order that hits it takes liquidity

What MiCA asks of a trading platform

In the EU, bringing together many third parties' buying and selling interests in crypto-assets is operating a trading platform. That needs authorisation as a CASP, in the EUR 150,000 capital class. Article 76 then asks for:

  • Non-discretionary rules for fair and orderly trading
  • Systems that are resilient, handle peak order volumes and stay orderly under severe market stress
  • Rejection of orders that exceed pre-set volume and price thresholds or are clearly erroneous
  • Public bid and ask prices and depth during trading hours, and each trade's price, volume and time
  • No dealing on own account on the platform the operator runs
  • Order data kept for the authority for at least five years

Who needs a matching engine

Only a venue where many customers' orders meet: a crypto exchange, or a securities venue such as a multilateral trading facility under the EU's MiFID II. MiFID II also requires a regulated market to be able to halt or constrain trading temporarily when a price moves significantly in a short period.

A broker app, an on-ramp or an OTC desk has no need of one. Each prices a customer's request and executes with a liquidity provider or on someone else's venue.

Matching engine, order book or RFQ?

Order book
The data: the resting orders, level by level. The matching engine is the logic that matches incoming orders against them.
Request for quote (RFQ)
A participant asks for a price and gets one or more quotes that only the requester can accept. No order rests in a public queue.
Automated market maker (AMM)
Prices come from a liquidity pool and a formula, not from matching orders. The EU's transparency standard for MiCA lists it as a separate type of trading system.
Smart order router
Sends orders to other venues' matching engines rather than matching them itself.

Where a matching engine shows up in a platform

Modules that do the work

Platforms that need it

Guides that go deeper

Where it is written

The laws and standards this page's facts come from.

General information, not legal advice: what applies to you depends on your services and your market.

Every term

Start your project

Tell us the idea. We'll show you the platform.

One call is enough to map your product to the modules that already exist.

  • Response in under one business day
  • NDA on request
  • No obligation
How can we help?