Empirical Strategy & Execution ResearchPosition Sizing, Leverage & Drawdown Discipline

How to Calculate Order Book Depth: Formulas & Slippage

Sum price times quantity on each side within mid-price bands. Then walk the book to estimate slippage and check quote persistence before sizing orders.

How to Calculate Order Book Depth: Formulas & Slippage — Pukna Quantitative Research Overview [lang:en][scope:universal_9lang][form:cover_hero][layout:asymmetric_metric_spotlight]
Contents6 sections
  1. What Are the Core Order Book Depth Formulas?
  2. Mid-Price and Percentage-Band Thresholds
  3. Base Volume, Quote-Notional Depth and Order Book Imbalance
  4. How Do You Calculate ±2% Depth on a BTC/USDT Level 2 Book?
  5. Building the Cumulative Bid and Ask Table
  6. Applying the Cutoff and Computing Imbalance
  7. How Does Walking the Book Determine Fill Price and Slippage?
  8. Volume-Weighted Execution Price Formula
  9. Deep vs. Shallow Books: Why Slippage Can Scale Nonlinearly
  10. How to Read Order Book Depth Charts and Filter Microstructure Distortions
  11. Depth Chart Anatomy: Walls, Slopes and Spread Gaps
  12. Four Distortions That Make Displayed Depth Unreliable
  13. How Should Depth Metrics Govern Position Sizing and Regime Execution?
  14. Sizing Limits and Grid-Spacing Floors
  15. Pairing Exchange Depth Checks with Multi-Timeframe Signal Validation
  16. Frequently Asked Questions

Order book depth measures resting limit-order liquidity within a specified price range. To calculate it from a Level 2 (L2) snapshot, find the midpoint between the best bid and best ask, then sum price times quantity separately for bids and asks within a ±1% or ±2% band. Express each total in the quote currency, such as USDT. Displayed depth measures liquidity at the time of observation; estimating execution costs requires walking the book for a specific order size.

  • Measure Depth in Quote Currency: Convert token quantities into USDT for meaningful cross-pair comparisons.
  • Apply Consistent Price Bands: Use ±0.5%, ±1%, or ±2% cutoffs around the midpoint.
  • Simulate the Actual Fill: Calculate the volume-weighted execution price across consumed price levels.
  • Check Liquidity Persistence: Evaluate quote cancellations and execution costs before determining order size.

What Are the Core Order Book Depth Formulas?

Mid-Price and Percentage-Band Thresholds

A Level 2 order book aggregates resting limit-order quantities by price. The best bid is the highest displayed buy price, while the best ask is the lowest displayed sell price. Their difference is the quoted spread. One basis point (bp) equals 0.01%.

★ P ≥ 70 · High-Conviction Edge ◆ P ≈ 50 · Neutral Regime Gate ▲ P < 45 · Chop & Whipsaw Filter ■ 1x–3x · Capped Integer Leverage

Calculate the midpoint using P_mid = (Best Bid + Best Ask) / 2 and the quoted spread using Spread (bps) = (Best Ask - Best Bid) / P_mid × 10,000. These formulas assume a valid, uncrossed order book with displayed quotes on both sides.

For band width k, include bids satisfying P_bid >= P_mid × (1 - k) and asks satisfying P_ask <= P_mid × (1 + k). Set k to 0.005, 0.01, or 0.02 for ±0.5%, ±1%, or ±2% respectively. Narrower bands isolate nearby execution capacity; wider bands capture more distant liquidity.

Base Volume, Quote-Notional Depth and Order Book Imbalance

At 100,000 USDT per BTC, 50 BTC represents 5 million USDT of liquidity. Fifty tokens priced at 2 USDT represent just 100 USDT. Quote-notional depth therefore supports comparisons that raw token quantities cannot.

Metric Formula Unit Execution Use
Base Depth sum(Q_i) Base token Available token quantity
Quote-Notional Depth sum(P_i × Q_i) USDT Cross-pair comparisons
Percentage-Band Depth sum(P_i × Q_i) within P_mid × (1 ± k) USDT Liquidity within a defined range
Order Book Imbalance (OBI) (Bid Depth - Ask Depth) / (Bid Depth + Ask Depth) -1 to +1 Relative bid/ask asymmetry

Calculate OBI using the same quote-notional units and percentage band on both sides. Zero indicates equal depth; +1 indicates only bids, and -1 only asks. If combined depth is zero, OBI is undefined. Imbalance alone cannot establish the direction of the next trade.

How Do You Calculate ±2% Depth on a BTC/USDT Level 2 Book?

The following hypothetical snapshot illustrates why percentage boundaries matter. Its best bid is 99,990 USDT and best ask is 100,010 USDT, producing a midpoint of 100,000 USDT and a quoted spread of 2.0 bps.

Building the Cumulative Bid and Ask Table

Side & Tier Price (USDT) Size (BTC) Level Notional (USDT) Cumulative ±2% Notional (USDT) / % From Mid / Band Status
Ask 5 102,700 9.00 924,300 Cumulative ±2% Notional (USDT): — · % From Mid: +2.70% · Band Status: Excluded
Ask 4 101,900 4.00 407,600 Cumulative ±2% Notional (USDT): 1,133,662 · % From Mid: +1.90% · Band Status: ±2%
Ask 3 101,300 3.50 354,550 Cumulative ±2% Notional (USDT): 726,062 · % From Mid: +1.30% · Band Status: ±2%
Ask 2 100,600 2.50 251,500 Cumulative ±2% Notional (USDT): 371,512 · % From Mid: +0.60% · Band Status: ±1%, ±2%
Ask 1 (Best Ask) 100,010 1.20 120,012 Cumulative ±2% Notional (USDT): 120,012 · % From Mid: +0.01% · Band Status: All three bands
Bid 1 (Best Bid) 99,990 1.50 149,985 Cumulative ±2% Notional (USDT): 149,985 · % From Mid: -0.01% · Band Status: All three bands
Bid 2 99,400 3.00 298,200 Cumulative ±2% Notional (USDT): 448,185 · % From Mid: -0.60% · Band Status: ±1%, ±2%
Bid 3 98,800 4.50 444,600 Cumulative ±2% Notional (USDT): 892,785 · % From Mid: -1.20% · Band Status: ±2%
Bid 4 98,100 5.00 490,500 Cumulative ±2% Notional (USDT): 1,383,285 · % From Mid: -1.90% · Band Status: ±2%
Bid 5 97,400 8.00 779,200 Cumulative ±2% Notional (USDT): — · % From Mid: -2.60% · Band Status: Excluded
How to Calculate Order Book Depth — How Do You Calculate ±2% Depth on a BTC/USDT Level 2 Book? [lang:en][scope:universal_9lang][domain:empirical_analysis][form:section_chart][layout:horizontal_pipeline]
Fig. 1: How to Calculate Order Book Depth — How Do You Calculate ±2% Depth on a BTC/USDT Level 2 Book?

Applying the Cutoff and Computing Imbalance

  1. Midpoint: (99,990 + 100,010) / 2 = 100,000 USDT.
  2. Boundaries: ±1% spans 99,000–101,000 USDT; ±2% spans 98,000–102,000 USDT.
  3. ±1% Depth: Bids total 448,185 USDT (4.50 BTC); asks total 371,512 USDT (3.70 BTC).
  4. ±2% Depth: Bids total 1,383,285 USDT (14.00 BTC); asks total 1,133,662 USDT (11.20 BTC).
  5. ±2% OBI: (1,383,285 - 1,133,662) / 2,516,947 ≈ +0.099. The equivalent ±1% OBI is approximately +0.094.

Including the two excluded levels inflates combined depth by 67.7%, from 2,516,947 to 4,220,447 USDT, while reducing apparent OBI to approximately +0.025. The nearby liquidity has not changed; only the measurement range has.

A similar distinction applies to token valuations. Reviewing crypto market capitalization and token liquidity helps distinguish headline valuation from executable market capacity.

How Does Walking the Book Determine Fill Price and Slippage?

Volume-Weighted Execution Price Formula

Under a static-book assumption, a market order consumes consecutive price levels until its quantity is filled. Calculate P_exec = sum(P_i × q_i) / sum(q_i), where q_i is the quantity actually matched, including a partial fill at the final level.

For buys, midpoint-relative slippage is (P_exec - P_mid) / P_mid × 100. For sells, use (P_mid - P_exec) / P_mid × 100. Both express adverse execution as a positive percentage, excluding transaction fees.

A hypothetical 5 BTC market buy in the preceding snapshot consumes 1.20 BTC at 100,010 USDT, 2.50 BTC at 100,600 USDT, and 1.30 BTC at 101,300 USDT. Total execution cost is 503,202 USDT before fees.

The resulting average fill is 100,640.40 USDT, giving slippage of 0.6404%, or 64.04 bps. Effective spread, calculated as 2 × |P_exec - P_mid| / P_mid × 10,000, equals 128.08 bps, roughly 64 times the quoted spread.

Actual fills may differ because of cancellations, replenishment, competing orders, or hidden liquidity. If the snapshot lacks sufficient quantity, report the unfilled balance rather than extrapolating an unsupported execution price.

Deep vs. Shallow Books: Why Slippage Can Scale Nonlinearly

A tight spread can conceal expensive execution beyond the best quote. The following hypothetical fill scenarios compare a deep major pair with a shallow altcoin offering 180,000 USDT of ask depth within +1% of its midpoint. Exact fills require the full price-level distribution.

Market Buy Liquidity Profile Average Fill (USDT) Slippage (bps) Effective Spread (bps)
25,000 USDT Deep pair; 100,000 midpoint 100,005.00 0.50 1.00
150,000 USDT Deep pair 100,015.00 1.50 3.00
500,000 USDT Deep pair 100,054.49 5.45 10.90
25,000 USDT Shallow altcoin; 10.00 midpoint 10.0050 5.00 10.00
150,000 USDT Shallow altcoin 10.0784 78.40 156.80
500,000 USDT Shallow altcoin 10.2754 275.40 550.80

In the shallow-book scenario, a twentyfold increase in order size raises slippage from 5.0 to 275.4 bps. That represents an execution-price premium of 2.754%, not necessarily a realized trading loss. Splitting orders may reduce immediate book consumption if liquidity replenishes, but introduces exposure to subsequent price changes. The same trade-off matters when evaluating dollar-cost averaging and staggered-entry costs.

How to Read Order Book Depth Charts and Filter Microstructure Distortions

Depth Chart Anatomy: Walls, Slopes and Spread Gaps

A depth chart plots cumulative resting quantity or notional against price. Check the vertical-axis units before comparing charts. The central gap represents the quoted spread; steep steps identify concentrated orders. Flat sections reveal sparse liquidity where consuming one price level can produce a substantial jump to the next available quote.

How to Calculate Order Book Depth — How to Read Order Book Depth Charts and Filter Microstructure Distortions [lang:en][scope:universal_9lang][domain:empirical_analysis][form:section_chart][layout:risk_guardrail_stack]
Fig. 2: How to Calculate Order Book Depth — How to Read Order Book Depth Charts and Filter Microstructure Distortions

Four Distortions That Make Displayed Depth Unreliable

Distortion Observable Warning Execution Filter
Spoofing and rapid cancellations Walls disappear as price approaches Compare quote persistence with completed trades
Hidden iceberg orders Executed quantity exceeds initially displayed size Observe replenishment after fills
Cross-venue fragmentation Inconsistent spreads and depth Compare accessible liquidity for compatible instruments
Volatility regime shifts Widening spreads and contracting depth Recalculate slippage before execution

Frequent cancellations alone do not prove spoofing, which involves deceptive intent. Similarly, perpetual futures liquidity cannot directly absorb spot orders. Around macroeconomic announcements, reviewing Bitcoin options implied volatility and DVOL provides uncertainty context, not a direct measurement of executable liquidity.

Illustrative comparison of a thin-book liquidity sweep and a spot-supported breakout [lang:en][scope:universal_9lang][domain:empirical_analysis][form:curated_visual][layout:versus_comparison]
Hypothetical breakout responses to different liquidity conditions.
Checkpoint Liquidity Sweep Spot-Supported Impulse
Candle Close Closes back inside the range Closes beyond the previous range
Resting Depth Asks disappear, creating a thin-book liquidity gap Bids replenish behind advancing prices
Order Book Skew and Taker Flow Taker-flow exhaustion weakens the move Sustained buying absorbs additional offers
Derivatives Rising open interest with limited spot participation Spot activity expands without comparable funding stress

When multiple pairs lose depth simultaneously, Pukna’s market environment research library, covering 39 indicators across eight dimensions, provides macroeconomic, liquidity, derivatives and on-chain context. Reviewing the Fear & Greed sentiment indicator alongside venue-level observations may help identify broader stress without establishing causation.

How Should Depth Metrics Govern Position Sizing and Regime Execution?

Sizing Limits and Grid-Spacing Floors

Calculate Order-to-Depth Ratio = Order Notional / Relevant Single-Side Band Depth × 100%. Estimate token-denominated order notional using the midpoint. Use ask depth for buys and bid depth for sells, never combined depth.

In the BTC example, +1% ask depth is 371,512 USDT. Illustrative thresholds of 5% and 15% correspond to approximately 18,576 and 55,727 USDT. These are screening thresholds, not validated execution limits. Walk the book to determine whether the proposed order meets its slippage budget.

Volatility-targeted exposure controls complement this check. They address potential price fluctuations, whereas depth analysis addresses execution capacity. Neither replaces the other.

For small percentage changes, an approximate grid-spacing cost floor is Grid Step (%) > Round-Trip Fee (%) + Buy Slippage (%) + Sell Slippage (%). Round-trip fees of 0.10% and estimated slippage of 0.15% per leg imply a 0.40% floor. Wider spacing does not establish profitability: inventory risk, adverse selection and fill behavior still matter.

Order / ±1% Depth Illustrative Execution Response Reassessment Condition
Under 5% Compare market and limit execution Estimated cost exceeds budget
5%–15% Evaluate smaller clips or passive limits Spread widens or depth falls
15%–35% Evaluate staggered limits or TWAP execution Estimated implementation shortfall increases
Above 35% Reconsider order size or timing Insufficient accessible liquidity

Calibrate these illustrative ranges to the instrument, venue and observed execution quality. For passive orders, account for maker fees and actual fill behavior rather than assuming aggressive-order slippage.

How to Calculate Order Book Depth — How Should Depth Metrics Govern Position Sizing and Regime Execution? [lang:en][scope:universal_9lang][domain:empirical_analysis][form:section_chart][layout:quad_matrix]
Fig. 3: How to Calculate Order Book Depth — How Should Depth Metrics Govern Position Sizing and Regime Execution?

Pairing Exchange Depth Checks with Multi-Timeframe Signal Validation

Order book quotes can change within milliseconds. A static OBI reading therefore cannot be extrapolated into a four-hour directional forecast without separate validation. Token unlocks illustrate how similar supply events can produce different market responses depending on spot liquidity and leveraged positioning.

Token unlock microstructure comparison: potential short squeeze versus sustained spot selling [lang:en][scope:universal_9lang][domain:token_project][form:curated_visual][layout:versus_comparison]
Illustrative event-window scenarios: short covering versus sustained spot selling.

Event-Window Order Book Dynamics

Dimension Short Squeeze Scenario Spot Distribution Scenario
Positioning Crowded shorts, potentially negative funding Elevated leveraged long exposure
Bid Depth Replenishment absorbs selling Bids thin as selling persists
Taker Flow Aggressive buying and short closures Sustained aggressive selling
Execution Reassess short-entry execution costs Recalculate sell-side slippage

Separate directional research from execution sizing. Pukna provides candle-level causal buy and sell signals for 42 major USDT pairs across 15m, 1h, 4h and 1d timeframes. Its 0–100 P score measures relative return quality, with 50 representing performance comparable to ordinary surrounding candles. Higher scores indicate stronger expected combined peak and terminal return quality within the horizon_bars forecast window, not a probability of profit.

At app.pukna.com, compare historical AUTO simulated strategy equity curves, win rates and maximum drawdowns at 1x, 2x and 3x integer leverage before considering real-time alert subscriptions. Historical simulations cannot establish future returns or replace exchange-specific execution analysis.

Pre-Trade Execution Verification Checklist

  1. Measure relevant single-side quote-notional depth.
  2. Walk the book and compare estimated costs with the strategy’s cost budget.
  3. Check quote persistence against completed trades.
  4. Review volatility, derivatives positioning and macroeconomic conditions.
  5. Evaluate directional strategy risk separately from executable order size.

Frequently Asked Questions

What is the difference between ±1% and ±2% order book depth?

The ±1% band measures resting liquidity closer to the midpoint, while ±2% includes additional price levels farther away. Both sum price times quantity within their respective boundaries. Unlike 24-hour trading volume, which records completed trades, depth measures currently displayed orders. Greater depth does not establish cheaper execution because liquidity distribution also matters.

Does higher bid depth than ask depth mean a cryptocurrency price will rise?

No. Positive Order Book Imbalance indicates greater displayed bid depth within the selected range, not a reliable upward price forecast. Bids may be canceled or consumed by aggressive selling. The BTC long-short account ratio provides additional positioning context, although account counts do not directly measure the notional size of leveraged positions.

How do you read an order book depth chart before placing a market or grid order?

Check the quoted spread, cumulative depth on the relevant side, and gaps between nearby price levels. Large vertical steps represent concentrated displayed liquidity, while flat sections indicate limited resting size. Then simulate execution for the actual order quantity. A grid strategy should also account for fees, both execution legs, and changing market conditions.

Put this into practice

Create a free account to browse live signals and test your own rules.

Contents

  1. What Are the Core Order Book Depth Formulas?
  2. Mid-Price and Percentage-Band Thresholds
  3. Base Volume, Quote-Notional Depth and Order Book Imbalance
  4. How Do You Calculate ±2% Depth on a BTC/USDT Level 2 Book?
  5. Building the Cumulative Bid and Ask Table
  6. Applying the Cutoff and Computing Imbalance
  7. How Does Walking the Book Determine Fill Price and Slippage?
  8. Volume-Weighted Execution Price Formula
  9. Deep vs. Shallow Books: Why Slippage Can Scale Nonlinearly
  10. How to Read Order Book Depth Charts and Filter Microstructure Distortions
  11. Depth Chart Anatomy: Walls, Slopes and Spread Gaps
  12. Four Distortions That Make Displayed Depth Unreliable
  13. How Should Depth Metrics Govern Position Sizing and Regime Execution?
  14. Sizing Limits and Grid-Spacing Floors
  15. Pairing Exchange Depth Checks with Multi-Timeframe Signal Validation
  16. Frequently Asked Questions