You place a buy order expecting a clean fill. A second later, your trade confirms, but at a price slightly different from what you saw on screen. Nothing went wrong. Crypto order matching is a system working exactly as designed, deciding which orders fill first and at what price, every single time you trade.
Every exchange, from the biggest global platform to a small regional one, runs on this same core mechanic. Once you understand how it actually works, a delayed fill or a slightly worse price stops feeling random.
This guide breaks the matching process down step by step, so you know exactly what happens the moment you hit buy or sell.
Definition: Matching Engine The core exchange software that receives every buy and sell order, checks the order book for a compatible counter-order, and executes a trade the instant one is found.
A matching engine, sometimes called an execution engine, is the single system standing between your order and an actual trade. When you place an order, it gets timestamped and sent straight to this engine, which checks whether a matching order already sits on the opposite side of the order book.
If a match exists, the trade executes immediately. If no match exists, your order joins the queue and waits, either until another trader’s order matches it, or until you cancel it yourself. This is the same logic behind how every crypto exchange matching engine operates, whether it is running a spot market or a futures market.
Almost every major exchange uses the same rule, called price-time priority, sometimes shortened to FIFO (first in, first out). It works in two clear steps.
Step 1: Price wins first. The best available price always gets matched before any other price. A sell order offered at a lower price is filled before a sell order offered at a higher price, no matter which one was placed first.
Step 2: Time breaks ties. When two or more orders sit at the exact same price, the order that arrived earliest gets filled first. This is your position in the order queue at that price level.
| Order | Price | Time Placed | Fill Order |
|---|---|---|---|
| Order A | $65,100 | 10:00:01 | 1st (best price) |
| Order B | $65,100 | 10:00:03 | 2nd (same price, later time) |
| Order C | $65,105 | 09:59:58 | 3rd (worse price, despite arriving first) |
This table shows why placing an order first does not always help. Order C was placed earliest but has the worst price, so it fills last, well behind two orders placed after it. Price-time priority treats every trader the same way. A retail order and an institutional order at the identical price and identical timestamp get identical treatment, since the only inputs the engine reads are price and time.
A smaller number of exchanges use pro-rata matching instead, where orders sitting at the same price all get filled proportionally to their size rather than strictly by arrival time. This is far less common than price-time priority in retail crypto trading, but it shows up on some derivatives venues, so it’s worth knowing the name if you ever see it mentioned in an exchange’s documentation.
Every order, no matter the size or the platform, follows the same short sequence inside the matching engine.
The diagram below shows this same sequence as a simple flow, from order submission through to either an instant fill or a resting position in the book.

Large orders don’t always match all at once. If your buy order is bigger than the size resting at the best ask, the engine fills what it can at that price, then moves to the next price level for the rest. This is called a partial fill, and it is common whenever an order’s size exceeds the depth sitting at the best available price.
Not every order behaves the same way once it reaches the order matching engine. The order type you choose decides whether you get price certainty, fill certainty, or neither.
Definition: Market Order An order that fills immediately against whatever price is currently resting on the opposite side of the book, with no price guarantee.
Definition: Limit Order An order that only fills at your specified price or better, with no guarantee that it fills at all.
A market order is always a taker order. It never rests in the book, since it is designed to match immediately at the best available price, even if that means sweeping through several price levels on a thin book.
A limit order can go either way. If it is priced away from the current market, it rests in the book as a maker order, adding to depth. If it is priced at or through the current market, it fills right away like a taker order instead.
A stop order works differently again. It sits completely inactive until a trigger price is hit, and then converts into either a market order (a stop-market order) or a limit order (a stop-limit order). Mudrex’s guide on why crypto futures positions can be liquidated despite a stop-loss breaks down exactly why these two behave so differently once triggered, and why that difference matters most during fast markets.
| Order Type | Rests in the Book? | Price Guaranteed? | Fill Guaranteed? |
|---|---|---|---|
| Market Order | No | No | Yes |
| Limit Order | Yes, if away from market | Yes | No |
| Stop-Market Order | No (until triggered) | No | Yes, once triggered |
| Stop-Limit Order | Yes, if resting after trigger | Yes | No |
Every match the engine makes has two sides, and the exchange labels each side differently for fee purposes. This maker/taker split is one of the most practical parts of understanding order execution in crypto.
A maker order adds liquidity. It rests in the book before it gets matched, giving other traders something to trade against. A taker order removes liquidity. It matches immediately against a resting order, consuming size that was already sitting in the book.
Mudrex’s full breakdown of crypto futures trading fees covers exactly how maker and taker rates are calculated, along with worked fee examples.
This question trips up a lot of new traders, so it deserves its own direct answer: whichever order arrived first. When two orders sit at the exact same price, the matching engine looks only at the timestamp. There is no other tiebreaker, not order size, not account type, not trading history.
This is precisely why professional market makers place and update orders constantly. Every time an order is modified, even slightly, it typically loses its place in the time queue and goes to the back at that price level. Standing still at the front of the queue, rather than repeatedly repricing, is often the better strategy for a resting maker order.
Behind the scenes, matching speed depends on the exchange’s underlying exchange infrastructure, not on any single trader’s setup. A few factors decide how fast your order actually gets processed.
Execution latency is the delay between submitting an order and it being processed by the engine. Retail exchanges typically process orders within milliseconds, while institutional systems chase latency in the microseconds.
Order routing determines which internal system or server queue handles your order first, especially on exchanges that separate spot and futures markets internally. Liquidity providers, market makers who consistently keep resting orders in the book, are what keep the queue deep enough for retail orders to fill smoothly instead of walking through several price levels.
For most retail traders, this underlying market microstructure rarely matters as much as simpler factors: choosing the right order type, checking liquidity before placing size, and understanding how the matching algorithm prioritizes price over speed. Mudrex’s guide to liquidity in crypto futures markets covers how to judge book depth before placing a trade that depends on fast, clean execution.
On crypto futures trading platforms, the matching engine takes on extra responsibilities that a simple spot exchange does not have.
Liquidation orders. When a trader’s margin falls below the maintenance level, the exchange automatically sends a forced market order into the matching engine to close the position. These orders behave exactly like any other market order once submitted, they simply weren’t placed by the trader.
Mark price vs. last traded price. Trades execute at the last traded price, but a separate figure called the mark price, blended from external spot prices, is used to calculate unrealised profit and loss and to decide when liquidation triggers. This separation exists specifically to prevent a brief price spike on one exchange from triggering unfair liquidations.
Funding settlement. Perpetual futures contracts have no expiry date, so exchanges use periodic funding payments between long and short traders to keep the contract price anchored near the spot price. The matching engine processes these settlements on a fixed schedule, independent of regular trade matching.
Together, this is also the foundation of price discovery in futures markets, working out an asset’s fair current value from the live push and pull of matched buy and sell orders, not just the last printed price. Mudrex’s guide on price discovery in crypto futures walks through this process in more depth.
No, and the difference comes down to who runs the matching engine. Everything covered so far describes a centralized exchange (CEX), where the exchange itself operates the matching engine on private infrastructure, maintains the order book, and executes trades internally.
Decentralized exchanges (DEXs) often work differently. Many skip a traditional order book and matching engine entirely, using an Automated Market Maker (AMM) model instead. In an AMM, prices come from a mathematical formula based on the ratio of two tokens sitting in a liquidity pool, not from matching individual buy and sell orders.
A smaller set of DEXs do run an order book, either fully on-chain or off-chain with on-chain settlement, which behaves closer to the CEX model described in this guide. Whichever design is used, a DEX generally trades some speed and cost for self-custody, since a centralized exchange keeps custody of user funds in exchange for faster, cheaper matching.
| Term / Metric | What It Means |
|---|---|
| Matching Engine | Exchange software that pairs buy and sell orders and executes trades |
| Order Book | Live list of resting buy and sell orders, ranked by price |
| Buy Order / Sell Order | An instruction to purchase or dispose of a contract or asset |
| Market Order | Fills immediately at the best available price, no price guarantee |
| Limit Order | Fills only at a set price or better, no fill guarantee |
| Stop Order | Inactive until a trigger price is hit, then converts to a market or limit order |
| Maker | Order that rests in the book and adds liquidity |
| Taker | Order that fills immediately and removes liquidity |
| Order Execution | The point at which a matched order becomes an actual trade |
| Bid Price / Ask Price | Highest price a buyer will pay / lowest price a seller will accept |
| Bid-Ask Spread | Gap between the best bid and best ask |
| Price-Time Priority | Matching rule: best price first, earliest timestamp breaks ties |
| Order Book Depth | Size resting at price levels near the current price |
| Trading Volume | Total size traded over a given period |
| Slippage | Gap between the expected fill price and the actual fill price |
| Order Book Imbalance | Difference in size between the bid side and ask side |
| Maker-Taker Fees | Fee structure where makers typically pay less than takers |
| Execution Speed | How quickly an order is processed once submitted |
| Market Impact | Price movement caused directly by an order consuming resting liquidity |
| VWAP | Volume-weighted average price, often used as an execution benchmark |
Crypto order matching is not a black box. It is a small, consistent set of rules: check the book, match on price, break ties on time, and classify every fill as a maker or a taker. Once you understand this sequence, every fill you get, clean or slightly worse than expected, makes sense as a direct result of price, timing, and the depth sitting in the book at that moment.
Put this understanding to work directly. Download the Mudrex app to trade crypto futures on a platform with transparent order execution and real-time depth. Subscribe to the Mudrex YouTube channel for regular walkthroughs on order types and execution mechanics.
An exchange’s matching engine checks every new order against the order book, executes a trade instantly if a compatible order exists, and holds the order in the book if it doesn’t.
It is the core exchange software that receives, timestamps, and pairs buy and sell orders, executing trades the instant a compatible match is found.
By matching a buy order against a sell order at a compatible price, using price-time priority to decide which orders get filled first when several are competing.
It gets timestamped and checked against the order book. If a matching sell order exists at or below your price, it fills immediately; otherwise it rests in the book.
Market orders fill instantly against the best resting price, taking liquidity. Limit orders either rest in the book as makers or fill instantly as takers if priced at the current market.
The order with the best price. If multiple orders share the same price, the one placed earliest is filled first.
The rule matching engines use to rank orders: the best price is always matched first, and ties at the same price are broken by whichever order arrived earliest.
Crypto futures trading involves leverage, and leverage magnifies both gains and losses. You can lose your entire margin, sometimes quickly, if positions move against you. The prices, order sequences, and worked examples in this article are illustrative only and do not reflect live market data or guaranteed outcomes. Nothing in this article is financial advice. Please consult a qualified financial advisor before trading crypto futures or using leverage.