Market making in crypto
- Published
- Updated
- Topic
- Crypto
- Reading time
- 6 min read
How crypto market makers earn the spread, why inventory and adverse selection eat into it, and how the Avellaneda–Stoikov model sets quotes.
A market maker quotes both sides of the order book: a price to buy and a price to sell. When both sides fill, the maker earns the spread between them. It sounds like a simple way to collect small profits all day. In practice, market making is a constant fight against two risks that eat the spread: holding inventory while the price moves, and trading with people who know more than you do.
This guide explains how crypto market making works, the costs and risks that decide whether it pays, and the standard model used to set quotes.
How a market maker earns
Suppose BTC trades around 60,000 USDT and you quote:
- Bid: 59,994 (you buy here)
- Ask: 60,006 (you sell here)
That is a 12 USDT spread, 2 basis points. If one buyer and one seller each trade 0.1 BTC with you, you have bought at 59,994 and sold at 60,006 and kept 1.2 USDT, before fees.
Three things can turn that into a loss:
- Fees. If the exchange charges a maker fee of 1 bp on each side, the two fills cost about 1.2 USDT, the whole spread. If it pays a maker rebate, the rebate becomes part of the profit. Fee tier is often the single biggest factor in whether a strategy works at all.
- Inventory risk. Usually only one side fills. You buy 0.1 BTC, nobody takes your ask, and the price falls 0.5%. You have lost 30 USDT, about 25 round trips' worth of spread.
- Adverse selection. Your bid tends to fill just before the price drops, because the traders hitting it have better information or faster data. The trades you get are, on average, worse than random.
Market making is profitable only when spread plus rebates exceed fees, inventory losses and adverse selection. All of these must be modelled in any backtest.
Inventory: skew your quotes
The basic defence against inventory risk is to skew quotes in the direction that reduces your position. When you hold too much BTC, lower both your bid and your ask, so that buying more is less likely and selling is more likely.
The best-known framework for this is the model of Avellaneda and Stoikov (2008). It sets a reservation price, the price at which you are indifferent to holding your current inventory:
reservation price r = s − q · γ · σ² · (T − t)
and an optimal total spread around it:
spread δ = γ · σ² · (T − t) + (2 / γ) · ln(1 + γ / k)
where:
- s is the mid-price and q your inventory (positive if long)
- γ is your risk aversion
- σ is volatility and (T − t) the time remaining in the trading horizon
- k describes how quickly the chance of a fill falls as you quote further from the mid
The intuition is more useful than the exact formula:
- Long inventory lowers your reservation price, so you quote lower and are more likely to sell.
- Higher volatility widens the spread, because holding inventory is more dangerous.
- Higher risk aversion both widens the spread and skews more strongly.
import math
def quotes(mid: float, inventory: float, gamma: float, sigma: float, horizon: float, k: float):
"""Avellaneda–Stoikov bid and ask. sigma is in price units per unit of time,
horizon is the time left in the same units, inventory is in base units."""
reservation = mid - inventory * gamma * sigma ** 2 * horizon
spread = gamma * sigma ** 2 * horizon + (2 / gamma) * math.log(1 + gamma / k)
return reservation - spread / 2, reservation + spread / 2
In crypto, which trades around the clock, practitioners often use a rolling horizon rather than a fixed end of day, and add hard limits on inventory and on loss per hour on top of the model.
Adverse selection: know when to step back
No quoting formula survives trading against better-informed flow. Common defences include:
- Widening or pulling quotes around known events: data releases, large liquidations, funding settlements, exchange maintenance.
- Watching order-book imbalance and recent trade direction. When aggressive buying dominates, a resting ask is likely to be run over.
- Using a reference price from a more liquid venue. If BTC moves on the largest exchange, quotes on a smaller one should move immediately, before someone trades against the stale price.
- Measuring markouts. For each fill, record the mid-price a few seconds and minutes later. If fills are consistently followed by moves against you, your spread is too tight for the flow you are getting.
Costs specific to crypto
- Fee tiers. Maker fees, and whether rebates exist at all, depend on the exchange, the product and your monthly volume. A strategy that works at a high-volume tier can lose money at the standard one.
- Funding on perpetual futures. Perpetual swaps exchange funding payments between longs and shorts, typically every eight hours on major exchanges. Inventory held across a funding time pays or receives it.
- Latency and rate limits. Quotes must be cancelled and replaced quickly. Exchanges limit how many requests you can send, and a strategy that needs more updates than the limit allows will be stuck with stale quotes.
- Exchange and counterparty risk. Funds held on an exchange are exposed to outages, withdrawal freezes and failure. Spreading capital across venues reduces the exposure but complicates inventory management.
Backtesting market making honestly
Market making is one of the hardest strategies to backtest, because your own orders change what happens. A credible simulation needs:
- Order-book data, not just trades or candles, so you can see where your quotes would have sat in the queue.
- A queue position model. A resting order fills only after the orders ahead of it at the same price. Assuming you fill whenever the price touches your level badly overstates fills.
- Realistic latency between seeing data, deciding and having the order live at the exchange.
- The actual fee schedule for the tier you will really trade at.
- Markout analysis to measure adverse selection on the simulated fills.
Then paper trade or run with small size, and compare live fills, markouts and inventory swings with the simulation before scaling up.
Summary
Market makers earn the spread and rebates and pay for fees, inventory moves and adverse selection. The Avellaneda–Stoikov model gives a principled way to skew and widen quotes as inventory and volatility change. In practice, fee tier, latency, careful handling of informed flow and an honest simulation of queue position decide whether the strategy pays.
This article is for education only and is not investment advice. Check the rules on crypto trading and derivatives where you live before trading.