Retired Blog

How a market order actually works

How a market order actually works

A market order is the simplest thing you can do on a crypto exchange. You click "buy" and the trade goes through immediately at whatever price the market is offering right now. That's it. That's the whole pitch.

Except it isn't quite that simple. The price you see on the chart isn't the price you pay. The price you pay is whatever the order book hands you, level by level, as your order eats through the resting offers from cheapest to most expensive. On a thick market with deep liquidity, the difference is invisible. On a thin market — or with a large enough order — the difference is the whole story.

This piece walks through what a market order actually does between the moment you click and the moment your position appears in your account. The mechanics are the same on Phemex, Binance, Coinbase, and every other exchange that runs a central limit order book. Once you understand the model, you can predict your fill price within a few basis points before you place the trade — and you'll know when not to use a market order at all.

The order book is the only thing that matters

Every modern exchange — crypto, equities, futures — runs the same machine underneath: a list of buy intentions and sell intentions, sorted by price, waiting to be matched. That list is called the order book. It's the single source of truth for what something costs at this exact moment.

Sellers post asks — "I'll sell 0.3 BTC if you pay me $100,000". Buyers post bids — "I'll buy 0.5 BTC if you let it go at $99,990". The asks stack upward in price (the lowest is the cheapest place to buy from). The bids stack downward (the highest is the best price you can sell into). The space between the lowest ask and the highest bid is the spread — usually a couple of dollars on BTC, often pennies on ETH.

The "price" your charting app shows you is one of these three numbers: the last trade, the mid-price between best bid and best ask, or the mark price (a smoothed reference designed to resist manipulation). All three are summaries. The actual landscape is the full book.

Here's a stylised view of what that landscape looks like — eight levels deep, with sizes that get bigger the further you walk away from the mid-price, which is what real books usually do:

That L-shape is normal. The market makers who post resting orders want to be filled near the price, not at extremes. Far-from-mid sizes are bigger because they're the inventory of someone willing to take a position only if the price moves substantially against them.

A market order is an instruction that says: ignore the price, take whatever's available, in priority order, until my size is filled. A limit order is the opposite: post a resting offer at a specific price and wait. Market orders are takers — they consume liquidity. Limit orders are makers — they add liquidity. Most exchanges charge takers more in fees because takers are the ones impatient enough to pay.

What a market order does, scroll by scroll

This is the part most articles skip. They show you the order book, mention the word "slippage", and move on. So scroll through the next bit — it's a single trade replayed level by level, the way the matching engine actually processes it. By the time you reach the bottom you'll know exactly what your average fill price ends up being and why.

Tools that go with this

When you're sizing a market order on a perp, the fee + slippage tax compounds quickly. Two tools to make it concrete:

  • Perpetual futures PnL calculator — models entry, exit, leverage, fees, and funding so you can see the all-in cost of a market-order entry vs. limit.
  • Position size calculator — translates account size + risk percentage + stop distance into the position size that actually keeps your risk capped at the number you intended.
Scroll · a 1.2 BTC market buy filling level by level
|
1Book
2Order
3Eats L1
4Eats L2
5Eats L3
6Slippage

The pattern is simple once you see it move: the matching engine consumes the cheapest ask first, exhausts it, moves to the next, exhausts that, and keeps walking up the book until the requested size is filled. Your average is the size-weighted blend of every level that contributed. The single number an exchange shows you on the chart — "BTC: $100,000" — is just the top of the book at that moment. The cost of taking 1.2 BTC is, in this example, $300 higher per coin than that headline number.

That gap between "the price on the chart" and "the price you actually pay" is slippage. It's a guaranteed feature of market orders, not a bug. It's the price of immediacy.

Why slippage gets bad fast

Three things make slippage worse, and only one of them is your fault.

Order size relative to depth. A $5,000 BTC market buy is invisible — you walk one or two levels and the average price barely moves. A $5 million BTC buy is a different animal: on most exchanges you'll walk through 50 to 200 levels and your average will be a meaningful percentage above the top of book. Big-orders-eat-deep-books is the whole reason institutional desks split orders across hours instead of clicking buy once.

Liquidity at the moment. Order books aren't static. The spread widens around news events, near major economic releases, during exchange degradation, and at the daily roll on perpetuals. The same trade size that costs $5 of slippage at noon might cost $200 ten minutes after a CPI release because most makers have pulled their resting orders to avoid being run over. The relevant metric is "depth at this exact second", not "depth on a normal day".

Market microstructure of the asset. Bitcoin perps on Binance or Phemex have hundreds of millions of dollars resting within 0.05% of mid. A small-cap altcoin might have $50,000 within 1% of mid. A market order that would be a non-event on BTC can be a 5% slippage disaster on a thinly-traded coin — sometimes worse than the daily candle range. This is why "the price moved against me" is often a self-inflicted wound: the order itself moved the price.

There's a fourth, sneakier source: toxic flow. Some market makers run automated programs that detect when a large taker is sweeping the book and immediately pull their resting offers — or even reprice them upward — before your order reaches them. This is most aggressive on lower-fee retail exchanges where the makers know they're at the back of the queue. You see it as the spread widening the instant you click. There's nothing illegal about it; it's just how a competitive market reacts to an aggressive taker.

Slippage on a single retail-sized BTC trade is small. On a $200 buy you'll typically pay 1-2 cents per coin in slippage — invisible against the spread. The reason to understand it isn't to avoid every micro-cost. It's to know which trades are subject to bigger slippage so you can size them right or use a different order type.

Market vs limit — when each is right

Use a market order when speed beats price. Examples:

  • You need out of a position right now because the thesis broke. The cost of holding is bigger than the cost of an extra few basis points on the exit.
  • You're trading a deeply liquid pair (BTC/USDT, ETH/USDT) and your size is small. Slippage will be invisible.
  • You need to enter immediately to qualify for an event — a level break, a news reaction. A limit order that doesn't fill at all costs you the entire trade.

Use a limit order when price beats speed. Examples:

  • You have a specific level in mind and you're patient. You'd rather miss the trade than pay through the spread.
  • Your size is non-trivial relative to depth. Splitting the size across limit orders at multiple price levels gives you a better average than slamming the whole thing through.
  • You're operating a strategy where every basis point matters — high-frequency arbitrage, market-making, large-position rebalancing. The fee discount on maker orders alone often justifies the wait.

A useful mental check before any trade: imagine the worst plausible fill price. Take the displayed price, add (for a buy) or subtract (for a sell) the recent average slippage on this asset at this time of day. If the worst plausible fill is still acceptable to your thesis, market orders are fine. If even a 0.2% slippage ruins the trade — meaning your edge per trade is below 0.2% — you don't have an edge that survives execution. That's a strategy problem, not an order-type problem.

Why limit-only execution matters for systematic trading

This is the thing nobody mentions in market-order tutorials: most automated trading strategies that try to use market orders die from slippage long before they die from a bad signal. The strategy looks great in backtest because the backtest assumes the headline price as the fill price. The live version pays through the spread on every entry and every exit, and that gap turns a positive expectancy into a flat or losing one.

A reasonable design choice for a systematic strategy is to specify the entry price exactly and skip the trade if the market never reaches it — better to miss a signal than to pay the spread on every fill. The trade-off is that some setups don't trigger at all; the upside is that the realised average fill stays close to the strategy's modelled fill, and the per-trade edge isn't quietly shaved by slippage on every entry.

For human discretionary trading, market orders are fine. For automated systems with thin per-trade edges, limit-only is closer to a survival requirement than a preference.

If you're newer to crypto trading mechanics generally, the London session piece covers when the market actually moves and why timing matters, and the broader why most traders lose money breakdown traces several other invisible-cost categories beyond slippage. The pricing context for any of these examples comes from the live BTC/ETH/SOL/XRP feed that powers the platform — same data, different views.

The one-line summary worth remembering

A market order trades immediacy for price. The price it actually pays is the size-weighted walk through the resting book, not the number on the chart. Most of the time on a deep market that walk costs you nothing. Sometimes — when the book is thin, when your size is large, when the spread is wide — that walk costs more than the trade was worth. Knowing which situation you're in is the difference between a tool that helps you and one that quietly bleeds you.

Frequently asked

Will a small market order ever fill at the displayed price?

Almost never exactly, almost always close enough not to matter. On BTC perps with a $1 spread, a small retail-sized buy will fill within a dollar or two of the chart price. The displayed price is the mid of the spread or the last trade — neither is the actual ask you'll consume.

How can I see how much slippage I would pay before placing a trade?

Most exchanges expose a depth chart or order book ladder in the trading interface. Sum the asks (for a buy) or bids (for a sell) up to your intended size and compute the size-weighted average. The difference between that average and the top of book is your expected slippage. A few exchanges show this directly as a "market impact" estimate next to the order entry form.

Are stop-loss orders the same as market orders?

A standard stop-loss is a market order that gets triggered when the price hits a chosen level. Once triggered it walks the book the same way any other market order does — with the same exposure to slippage, especially during fast moves where stops cluster. Some exchanges offer "stop-limit" orders that submit a limit instead of a market on trigger, which avoids slippage but introduces the risk of not filling at all if the price gaps through the level.

Why are market-order fees usually higher?

Market orders consume liquidity (taker fees), limit orders provide it (maker fees). Exchanges charge takers more because makers are subsidising the matching infrastructure by leaving inventory in the book. Typical crypto perp fees on a major exchange are 0.06% taker and 0.01% maker. Over a year of frequent trading the gap is significant.

Can a market order get rejected?

Yes — the most common reasons are insufficient margin, the asset being delisted or paused, or the exchange enforcing a maximum order size. Some exchanges also reject "fat finger" market orders whose implied price (the worst-case fill) is too far from the last traded price, as a safety mechanism against accidental clicks. The order returns an error rather than filling at a wild price.

Is using a market order on a perp the same as on spot?

Mechanically yes — both walk the book the same way. The differences are around it. Perps have funding rates, margin requirements, and a separate mark-price-vs-last-price distinction that affects how stops trigger. Spot orders settle the underlying asset; perps just adjust your position. The order-walking math is identical.

Why do automated trading bots prefer limit orders?

Per-trade edges in automated systems are usually a fraction of a percent. Even modest slippage from market orders can flip a profitable strategy to break-even or worse, while limit orders keep the realised price aligned with the strategy's assumed fill. The trade-off is that some limit orders never fill — but a missed trade costs nothing, while every market-order trade pays the spread.

Sources
  • Phemex public order book API documentation — phemex.com/user-guides/api-overview. Reference for live ladder structure used to model the depth example.
  • Binance order types reference — binance.com/en/support/faq/order-types. Definitions for taker / maker / market / limit on the perps venue most commonly used by retail.
  • Trades, Quotes and Prices — Bouchaud, Bonart, Donier, Gould (Cambridge University Press, 2018). Standard reference on order book mechanics, market impact, and slippage modelling.
  • Algorithmic and High-Frequency Trading — Cartea, Jaimungal, Penalva (Cambridge University Press, 2015). Treatment of limit-order-book dynamics and execution strategies.
  • Wikipedia: Order matching systemen.wikipedia.org/wiki/Order_matching_system. Plain-language summary of how matching engines process incoming orders.
  • Wikipedia: Slippage (finance)en.wikipedia.org/wiki/Slippage_(finance). General-purpose definition independent of any specific exchange.
← All posts