Calculate the bid–ask spread of a market in absolute terms and as a percentage of the mid price.
The bid–ask spread is the gap between the highest price buyers are willing to pay (bid) and the lowest price sellers will accept (ask). It is the implicit cost of trading with market orders: buying at the ask and immediately selling at the bid loses you exactly the spread.
Spread = Ask − Bid
Mid price = (Ask + Bid) / 2
Spread % = Spread / Mid price × 100The percentage is computed against the mid price, the common convention. Tight spreads (hundredths of a percent on major pairs) indicate deep liquidity; wide spreads signal thin markets and higher round-trip costs.