Order Matching Engine: Everything You Need to Know

13 min read

Order matching engines are the backbone of modern financial markets, facilitating the seamless execution of trades. Understanding their function and significance is crucial for each market participant.

In this article, we’ll give you an insight into what an order matching engine is, the mechanics behind it, and what to pay attention to when choosing one for your exchange or dark pool.

Price discovery at a glance

Trading venues such as exchanges and over-the-counter markets are crucial to the frictionless exchange of assets such as stocks, commodities, and cryptocurrencies, as well as derivatives such as futures, options, and more.

Their purpose is to create a level playing field on which market participants can access price information to buy and sell securities. The willingness of traders to buy or sell an asset at a predefined volume and price is logged by these venues, forming public “order books” for each tradable symbol.

As traders enter and exit the market, buying and selling at the current best price (the top of the order book), their “market” orders are filled from these “limit” orders stored in the order book.

Every time a trade is made, the balance between the best available buy/sell prices and volumes thereof is altered as liquidity is removed, thus setting a new prevailing market price. This is what market participants mean when they talk about price discovery.

What is an order matching engine?

An order matching engine (OME) is a software system that matches buy and sell orders from market participants to facilitate the execution of trades.

In other words, the matching engine is what allows all the above to take place, leading to the creation of efficient global markets on which vast amounts of liquidity can change hands each day.  All other exchange systems can be regarded as peripheral to the matching engine because without it there is effectively no market to speak of.

Regardless of the asset class your trading venue specializes in, you’ll require a matching engine in order to fulfill incoming market orders for immediate execution with liquidity from limit orders in the order book.

We’ve already discussed the order book, which is one of the main parts of a matching engine. At the heart of it all we have the matching algorithm, which performs most of the heavy lifting when it comes to order execution.

The matching algorithm follows predefined rules that determine which orders are prioritized in their execution and how.

An example of such rules is Price-Time Priority. This is one of the most popular order matching rulesets in which orders are matched according to their price and the time they were placed. Also known as FIFO (first in, first out), the oldest order at a particular price level will be prioritized in this ruleset over newer orders at the same price.

Pro-Rata is a different set of matching rules under which the matching algorithm prioritizes larger orders, providing them with a proportionally larger share of the available liquidity at a given price level.

What to keep in mind when choosing a matching engine?

Choosing the right matching engine is a critical decision that requires careful evaluation. Let’s have a look at some factors you need to consider.

Asset classes

Right off the bat, it’s important to know which asset classes your trading venue will be offering.

Not all matching engines are compatible with every asset class. Of course, there are multi-asset matching engines, like DXmatch, that are completely agnostic to the underlying assets they work with. That’s why they can be easily used on all conventional markets and even some unconventional ones, like prediction markets.

Order Matching Engine - DXmatch

Order types

Ensure that the matching engine supports common order types like Limit, Stop, Stop Limit, and Market orders. Check if specialized order types like Trailing Stops, One-Cancels-the-Other (OCO), and Iceberg orders are available or planned for future implementation.

Find out if a prospective provider can offer these, or whether they have a roadmap in place for adding this functionality at a later date.

Latency considerations

Another crucial aspect of your matching engine, which will also be determined by your clientele, is its performance characteristics.

How important is latency to your business? For example, institutions deploying high-frequency trading strategies require as close to zero latency as the laws of physics will allow.

In these applications, bare metal systems that are co-located in exchange data centers are essential. In these cases, even the shortness of the cables used to connect client servers to exchange matching engines can confer a minuscule advantage on one participant over another.

Throughput and availability

On the other side of the spectrum, we have venues such as cryptocurrency exchanges, which are far less concerned with latency. These venues are overwhelmingly used by retail clients, so the allowances for this type of trading venue are radically different from the HFT example above.

Retail exchanges in general tend to favor throughput over latency as they have extensive client bases that may all want to enter positions at certain times, such as during the frenzy of a crypto bull market.

In our own DXmatch solution, we use clusters of independent order processing units (replicated state machines), all equal copies of one another in order to maintain high availability in a cloud environment. In the case of throughput, we employ horizontal scaling by splitting the venue’s available instruments into multiple segments, each with its own copy of the matching engine.

Our DXmatch engine can be installed in both a bare metal server setup, or deployed on the cloud for businesses whose latency requirements are not as strict, and that value the flexibility and cost-effectiveness of cloud computing over bare metal.

It’s important to note that while high availability and throughput can be maintained with a cloud-based setup, it’s extremely difficult to get order processing latency under 100 milliseconds with a cloud deployment.

As mentioned above, this is just not viable in certain applications. Using an advanced bare metal setup, our own DXmatch engine can deliver wall-to-wall latency of under 100 microseconds via FIX API.

Connectivity

This brings us to connectivity protocols, which bring together different parts of the exchange infrastructure and allow it to connect to external third parties.

Evaluate the connectivity protocols offered by the matching engine to enable seamless integration with external third parties like market data providers, custodians, clearing agents, regulators, settlement systems, and wallet management providers. REST and FIX APIs are industry standards.

Admin features

Finally, we have user-facing administration software for monitoring and manually intervening when necessary.

Ensure that the matching engine provides user-friendly administration software for monitoring and intervention. This software should allow easy visualization of activities on the exchange and include controls like a kill switch to cancel orders or mass cancel features.

For example, a kill switch to cancel existing orders and prevent new ones from a participant that has been identified as a bad actor, or a mass cancel feature, allowing administrators to cancel all open orders pertaining to an individual symbol, or entire asset class.

Order Matching Engine - DXmatch

Experience DXmatch, a matching engine by Devexperts

DXmatch is Devexperts’ proprietary order matching engine designed for ultra-low latency and high throughput applications. It is trusted by regulated securities exchanges, dark pools, cryptocurrency exchanges, and OTC venues worldwide.

With DXmatch, you can build an exchange from scratch and offer a wide range of underlying assets, including stocks, bonds, futures, options, cryptocurrencies, and non-standard assets like NFTs, real estate, and prediction markets. It ensures regulatory compliance and supports swap contract execution.

Advantages of DXmatch

Ultra-low latency engine

DXmatch ensures high-performance order matching with sub-100 microseconds latency. This level of speed allows for faster execution of trades, making it suitable for high-frequency trading strategies that require near-zero latency.

Scalable engine

The DXmatch engine is designed to scale horizontally meaning that its throughput increases linearly with horizontal scaling. This scalability ensures that the engine can handle a growing number of transactions without compromising performance.

DXmatch supports multi-segment setup allowing for efficient management and execution of multiple trading segments simultaneously. With a capacity of 30,000 matches per segment, DXmatch can handle high volumes of trades across various segments.

Engine to deploy anywhere

DXmatch can be easily deployed on different platforms, including bare metal servers or cloud platforms like AWS and Google Cloud. This flexibility allows trading venues to choose the deployment option that best suits their needs and infrastructure.

Migrate hassle-free to a new engine

DXmatch provides a guided path for migrating working orders from legacy engines to its platform. This migration process ensures a smooth transition and minimizes disruptions during the switch to DXmatch.

“In the ever-expanding world of financial markets, DXmatch stands out as the ultimate solution. Our experience with clients is a clear demonstration of our unwavering commitment to innovation and adaptability.”

– Sergey Samushin, Project Manager of DXmatch

Engine for trading derivatives

DXmatch supports trading derivatives allowing trading venues to expand their offerings beyond cryptocurrencies. This capability enables the inclusion of derivative products in the exchange’s portfolio.

Multi-leg trading

DXmatch enables the execution of multi-leg trading strategies allowing users to create complex strategies within the engine itself. This feature enhances trading flexibility and efficiency.

Enterprise-grade APIs

DXmatch offers high-quality APIs including the FIX 5.0 protocol that provide market access with sub-100 microseconds latency. These APIs also support mass cancels and mass quoting, catering to the needs of market makers. 

Risks mitigation

DXmatch is a modular platform equipped with advanced risk management features. These include price slippage limits, built-in fat finger protection, kill switch, self-trade prevention, message throttling, min/max quantity validation and min/max price validation. The features safeguard your customers and protect your business adding value to your clients and ensuring that your business remains protected even in worst-case scenarios.

In summary, DXmatch offers a number of advantages, such as ultra-low latency, scalability, multi-segment setup, deployment flexibility, smooth migration process, support for derivatives, multi-leg trading, and enterprise-grade APIs. These features make DXmatch a powerful and reliable choice for trading venues and exchanges seeking an efficient and high-performance order matching engine.

The main components of Matching Engine

Console UI

The Console UI application within DXmatch provides a user-friendly interface for monitoring and administering orders on an exchange. It offers several functions that assist exchange administrators in managing and overseeing trading activities.

Market data

The Market Data Feed service offers the ability to receive real-time updates about the trading information such as quotes, last traded price, volumes and others. Common usages of this API include web-based trading systems (widgets like Watchlist or Market Depth) and public websites.

The information distributed by this service is not personalized, and there is no way to link events from the Market Data Feed to a specific market participant.

The Market Data Feed is designed to provide the latest market information rather than all events occurring in the market.

FIX API

DXmatch FIX Port application operates in two functional modes:

  • Trading mode. Gives access to the DXmatch exchange market by placing and managing orders.
  • Drop Copy mode. Allows to distribute real-time copies of order execution reports.

REST API

The API provides endpoints for trading and exchange management:

  • Trading – placing, modifying, and canceling orders via the Matching Engine.
  • Historical data – requesting historical orders data, related execution reports, and fills from the Data Warehouse.
  • Instruments management – listing new tradable instruments and managing instrument parameters.

The flagship of our exchange product ecosystem, DXmatch is unrivaled on the market. Often imitated, never duplicated, we are certain that it has to be seen in action to be believed, and so we’d like you to experience the power of DXmatch by taking it for a spin!

Contact us for an in-depth demonstration.