Ready to go further
Next: how does a gap between bid and ask add up?
The spread is a market maker's income and a taker's cost. The spread guide shows what it costs a bot that trades often.
What is included
- What it is, in plain words
- The formula or mechanism, with exact arithmetic
- How it hits grid, martingale and DCA bots
- A check you can run before you switch a bot on
Who it is for
- People who run or plan to run a trading bot
- Anyone reading a backtest or a bot sales page
- Readers who want the numbers, not the pitch
- Not advice, and not a signal service
Key facts
- A market maker keeps a bid (a price it will buy at) and an ask (a price it will sell at) in the book. Other traders take those prices, and the maker earns the spread between them if both sides trade.
- The risk is inventory. Fills do not come in matched pairs, so the maker ends up holding units while the price moves.
- In the made-up example below, 5 fills capture +$25.00 of spread, but the price falls while the maker holds 300 units, so the result is -$35.00 (calculated by us on 29 Oct 2026, exact).
- Large market makers are paid for the service in different ways, such as fee rebates or special terms, which vary by venue. A retail bot gets none of that by default.
- A retail bot that posts both a buy and a sell is quoting like a market maker, but it has higher costs, slower data and a smaller account.
What a market maker does
A market needs someone on both sides. When you want to sell, there must be a buyer ready at a price. A market maker is a firm or a program that stays ready to buy and sell at all times, so the market always has a quote. It posts a bid and an ask, for example a bid of 99.95 and an ask of 100.05. The gap, 0.10, is the spread. When one trader sells to the bid and another buys from the ask, the maker has bought at 99.95 and sold at 100.05, and keeps 0.10 for each unit.
Here is the catch. The buy and the sell rarely arrive together. Sometimes three sellers hit the bid before one buyer lifts the ask. Then the maker holds a position it did not choose. That position is called inventory, and it can lose money if the price moves against it.
Where the money comes from, and where it goes
- Spread capture. Each fill at the bid or ask earns about half the spread against the midpoint, as long as the price stays near where it was.
- Inventory risk. A long position loses when the price falls, and a short one loses when the price rises. A steady move in one direction is the worst case, because every fill adds to the position that is losing.
- Adverse selection. Some traders trade because they know something the maker does not. A bid hit by an informed seller is often followed by a lower price. The fills a maker most wants, the harmless ones, are not the only ones it gets.
- Costs. Fees, data, hardware and the cost of closing out inventory. These vary by venue and by firm.
To manage inventory a maker moves its quotes. If it is long, it lowers both prices, so its ask is more likely to be taken and its bid less likely. If it is short, it raises them. It also sets a limit on how much inventory it will hold and may widen the spread when the market is fast. These are design choices, not rules, and each firm makes them differently.
A worked inventory example on made-up numbers
A made-up maker quotes 0.05 either side of the midpoint, for 100 units on each side. So when the midpoint is 100.00, it bids 99.95 and asks 100.05. The table shows five fills while the price drifts down. Each row shows the midpoint when the fill happened, so the price it traded at is 0.05 away from that.
| Fill | Maker | Price | Units | Inventory after | Spread earned |
|---|---|---|---|---|---|
| 1 | Buys (hit on the bid) | 99.95 | 100 | +100 | $5.00 |
| 2 | Buys (hit on the bid) | 99.95 | 100 | +200 | $5.00 |
| 3 | Buys (hit on the bid) | 99.90 | 100 | +300 | $5.00 |
| 4 | Sells (lifted on the ask) | 100.00 | 100 | +200 | $5.00 |
| 5 | Buys (hit on the bid) | 99.80 | 100 | +300 | $5.00 |
The maker captured $25.00 of spread over the five fills. But four of the five were buys, because the price was falling and sellers were hitting its bid. It ends holding 300 units. The cash from the fills is -$29960.00, and the 300 units are worth +$29925.00 when valued at the final midpoint of 99.75. The net result is -$35.00.
-$29960.00 + 300 x 99.75 = -$35.00
Spread captured = 5 fills x 100 x 0.05 = $25.00
Inventory result = -$35.00 - $25.00 = -$60.00
The spread earned was real, and so was the inventory loss. The loss on the units held was $60.00, more than twice the $25.00 of spread captured. If the price had moved sideways, the maker would have kept most of that $25.00. That is the nature of the business: many small gains and a few large losses when a move runs one way. These numbers are made up to show that pattern and are not typical.
How a retail bot differs
A retail bot that places a buy limit and a sell limit around the price looks like a market maker, and a grid bot does this on many levels. The differences matter:
- Speed. Professional makers update quotes in a tiny fraction of a second. A retail bot is slower, so when the price jumps, its stale quote is the one that gets hit first. That is adverse selection at its worst. See high-frequency trading.
- Queue position. Limit orders fill in order. A large maker sits at the front of the line at many price levels, and a small bot sits behind them, so it gets filled mostly when the price is about to go through its level.
- Costs. A retail account usually pays fees and a wider effective spread, which can use up the half-spread a maker lives on. Check your venue's fee schedule, since it varies.
- Capital and limits. A small account cannot hold a large inventory through a move, and a leveraged one may meet a margin call before the price turns.
- No obligation or rebate. Some venues give registered makers lower fees or special terms in return for quoting. A retail bot normally has no such deal.
The same maths shows up in testing. A backtest that fills every limit order the moment the price touches it makes market making look better than it is. See how to backtest a trading strategy and spread.
What it does not tell you
This page describes the mechanism. It does not say a retail bot can earn the spread, or that market making is a good or bad business. The five fills are made up to show how inventory risk works, and a real maker trades many thousands of times with far smaller sizes per fill.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What is a market maker?
A firm or program that posts both a buy price and a sell price, so other traders can always trade. It aims to earn the spread between them.
How does a market maker make money?
By buying at the bid and selling at the ask many times. The gain per trade is small, and it depends on the price not running away while the maker holds inventory.
What is inventory risk?
The risk of holding units the maker did not plan to hold. If the price moves against that position, the loss can be larger than the spread earned.
Is a grid bot a market maker?
It is similar, because it posts buys and sells around the price. But it has no obligation, no speed advantage and usually higher costs, and a strong trend can leave it holding a losing position.
Can a retail bot do market making?
It can post two sided limit orders, but speed, queue position and fees work against it. It would need a test with honest fills before any conclusion.
Are the numbers on this page real?
Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.
Can I use this to decide whether to run a bot?
It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.
Is this financial advice?
No. It is general education about how markets work. The prices and sizes are made up.
Know the Risk Before You Run It
Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.
Trading carries a risk of loss