DoberInvest Channel RU

Futures and margin

Bid-ask spread:formula and a worked order-book example

The quoted spread is the gap between the best bid and best ask. This guide calculates it in dollars and basis points, then models a market order that consumes more than one price level.

Order book depth with buy orders on the left, sell orders on the right and a gap between them
In this guide 8

Bid-ask spread

Every two-sided market has prices from buyers and sellers. The bid is the highest displayed price a buyer offers; the ask is the lowest displayed price a seller accepts. Investor.gov defines the bid-ask spread as the difference between those two prices.

The spread is a useful first look at execution cost, but it is not the whole order book. A quoted spread describes the best displayed prices at one moment. A larger order can trade at several levels.

01Formula#

spread = ask − bid
mid price = (ask + bid) ÷ 2
spread percentage = spread ÷ mid price × 100
basis points = spread percentage × 100

One basis point is 0.01%.

02Worked quote model#

Assume an invented quote model with a best bid of 99.90 and best ask of 100.10. These are not live quotes.

The model inputs are:

  • modeled best bid: 99.90;
  • modeled best ask: 100.10.

The dollar spread is:

100.10 − 99.90 = 0.20

The mid price is:

The two modeled quotes sum to 200.00.

(100.10 + 99.90) ÷ 2 = 100.00

The relative spread is:

0.20 ÷ 100.00 × 100 = 0.20%

That equals 20 basis points.

If a trader buys at the modeled ask and could immediately sell only at the modeled bid, the round trip crosses the 0.20 spread before fees. This is a mechanical illustration, not a promise about the next available quote.

03Depth changes the average fill#

Assume an invented depth model with 5 units offered at 100.10, another 5 units at 100.20, and a market buy for 8 units:

Ask price Available quantity
100.10 5 units
100.20 5 units

A modeled market buy for 8 units would take 5 units at 100.10 and the remaining 3 units at 100.20. The modeled price contributions are 500.50 and 300.60, totaling 801.10. Its volume-weighted average fill would be:

[(5 × 100.10) + (3 × 100.20)] ÷ 8 = 100.1375

The best ask was 100.10, but the modeled average fill is 100.1375 because the order exceeded the quantity available at the top level. This difference is market impact within the simplified book, not a historical observation.

04Market and limit orders#

Investor.gov describes a market order as an instruction to buy or sell immediately; execution is generally expected, but the execution price can vary. A limit order sets a maximum buy price or minimum sell price, but it can remain unfilled.

That creates a trade-off:

  • a market order prioritizes immediacy and accepts price uncertainty;
  • a limit order controls the permitted price and accepts fill uncertainty.

Neither order type removes fees, latency or the chance that the book changes before the order reaches the venue.

05Why spreads differ#

Spreads can change with trading activity, volatility, order size, venue rules and the number of competing orders. Do not transfer a spread observed on one venue or instrument to another. Even two products with the same ticker can have different books.

For a real decision, record at least:

  1. venue and instrument identifier;
  2. timestamp and quote currency;
  3. best bid and ask;
  4. quantity available at each relevant level;
  5. order type and size;
  6. venue fees and any funding costs.

06What the spread does not show#

The top-of-book spread does not prove that a large order can fill near the quote. It also does not measure future price movement. Use an order-book depth calculation for the intended quantity, and distinguish the displayed snapshot from the eventual execution report.

07Sources#

Educational material, not investment advice. All order-book values are invented model inputs rather than current market data.

FAQ#

What is the bid-ask spread?
It is the difference between the lowest price offered by a seller and the highest price offered by a buyer. The worked model uses a 99.90 bid and a 100.10 ask, producing a 0.20 spread.
How do you calculate spread in percent?
Divide ask minus bid by the mid price and multiply by 100. In the model, the mid is 100.00 and the 0.20 spread is 0.20%, or 20 basis points.
Is the spread the full cost of a market order?
Not necessarily. A market order can consume several order-book levels, so its average fill may be worse than the best quote. Venue fees and later price changes are separate.
Can a limit order remain unfilled?
Yes. A limit order controls the worst permitted price, but it may not execute. Queue position, available depth and other participants' orders affect the fill.

DoberInvest on Telegram

Questions about this guide?

Ask in the English channel. That is also where we post charts, the levels we watch and what would change our mind. A system, not signals, and no profit promises.

Join the channel

This guide explains how the mechanics work; what you do with them is your own decision. Trading can lose you money, and leverage makes losses bigger and faster. 18+

Konstantin Shulga
AuthorKonstantin Shulga

Founder of DoberInvest, in the market since 2018. Teaches a system, not signals.

Read next

All guides

Charts and market context every day

Bitcoin, altcoins and the US market: levels we watch, what would change the picture, and why. A system, not signals, and no profit promises.