Liquidity & Execution Lab
Understand the Real Cost of Market Execution
Explore how order size and available order-book depth affect your estimated execution price.
See how order size and displayed depth change a hypothetical execution price. The walk is arithmetic on the book in front of you: a buy takes asks from the cheapest upward, and a sell takes bids from the highest downward.
- Choose buy or sell.
- Set the order size in base units.
- Read the average price, the cost versus the midpoint, and whether displayed depth can fill the order.
Synthetic or user-entered snapshots only. This page does not connect to an exchange, place orders, store a book, or recommend a trade. It is not a live market and it is not investment advice.
Result
Estimated execution price
100.08
Cost versus midpoint
8.00 bps
Fill
Fully filled
Your simulated buy order consumes two price levels, resulting in an average execution price of 100.08.
Trading fees are excluded. No fee was entered, so this is not an all-in cost.
03
Depth and the hypothetical walk
Bids accumulate from the best bid downward. Asks accumulate from the best ask upward. The pale line is the portion used by this order. The dashed line is the requested size. The vertical line is the VWAP of whatever quantity the visible book actually filled.
The depth chart appears when the book has a best bid below the best ask.
- Displayed bids
- Displayed asks
- Quantity used by this order
- Requested size
- VWAP of the filled quantity
Displayed depth, your order size, and the average price of what the book can fill. This picture is not a live market.
Select this panel and use the left and right arrow keys to inspect each level on the execution side.
04
Indicative result
Visible quantity can complete this order
Quoted book
- Best bid
- 99.95
- Best ask
- 100.05
- Midprice
- 100.00
- Absolute spread
- 0.10
- Relative spread
- 10.00 bps
- Total displayed bid quantity
- 30
- Total displayed ask quantity
- 32
This order
- Side
- Buy
- Requested base quantity
- 10
- Available on the execution side
- 32
- Filled quantity
- 10
- Unfilled quantity
- 0
- Fill ratio
- 100.00%
- Levels consumed
- 2
- Fee assumption
- 0.00 bps
Completed order
These rows appear only when visible depth covers the whole request. They are not reused for a partial book.
- Execution VWAP
- 100.08
- Cost versus midprice
- 8.00 bps
- Additional sweep versus best ask
- 2.9985 bps
- All-in unit cost
- 100.08
- Fee amount
- 0.00
- Fee-adjusted cost versus midprice
- 8.00 bps
Filled portion only
Visible depth cannot complete the order. The average below is partial-book arithmetic. It is not a completed-order VWAP and it is not a cost for the full requested size. Nothing beyond the visible book is invented.
- Partial-book VWAP
- —
- Filled-portion cost versus mid
- —
- Filled-portion sweep versus the touch
- —
- Fee on the filled notional
- —
- Fee-adjusted unit of the filled portion
- —
- Fee-adjusted cost of the filled portion only
- —
Levels used
| Price | Available | Filled | Left on level | State |
|---|---|---|---|---|
| The level table is filled when the page script runs. The worked example below records the same reference buy. | ||||
How to read it
A buy of 10 on the reference book takes 4 at 100.05 and 6 at 100.10. The completed-order VWAP is 100.08, which is 8.00 basis points above the midprice and about 2.9985 basis points worse than the best ask.
How the walk is calculated
A buy consumes asks from the lowest price upward. A sell consumes bids from the highest downward. The walk may take only part of the last level. It stops when the requested base quantity is filled or when visible quantity runs out. It does not create a further level, and it does not assume the book will refill.
The execution VWAP on this page is the volume-weighted average of that static walk: the sum of executed price times executed quantity, divided by executed quantity. It is not the VWAP of trades printed over a clock interval, and it is not a schedule that tries to match an interval VWAP. Those are different objects. Mixing them is a common way to misread a slippage calculator.
Before the walk, bids are sorted from high to low and asks from low to high. The prices and quantities themselves are not edited. If the same price appears twice on one side, the book is rejected. This tool does not add the duplicates together. Combine them yourself if they are one level. A crossed book, where the best bid is above the best ask, and a locked book, where they are equal, are labeled and are not given an execution VWAP.
Quoted spread and execution cost
The quoted spread describes the touch. It does not describe the cost of a size. Relative spread, in basis points, is 10,000 × (best ask − best bid) / midprice. An order larger than the quantity at the best price has to use worse prices. That extra distance is the sweep cost. For a buy it is 10,000 × (VWAP / best ask − 1). For a sell it is 10,000 × (1 − VWAP / best bid).
Cost versus the midprice includes both the distance from the mid to the touch and the sweep beyond the touch. For a buy it is 10,000 × (VWAP / midprice − 1). For a sell it is 10,000 × (1 − VWAP / midprice), so a positive number is still a cost. A buy that lifts only the touch has an additional sweep of zero. Its midpoint cost is then just the distance from the midprice to the ask.
A fee in basis points stays outside the raw VWAP. For a buy, all-in unit cost is VWAP × (1 + fee / 10,000). For a sell, net unit proceeds are VWAP × (1 − fee / 10,000). The fee-adjusted cost versus the midprice repeats the midpoint formula with that unit price. A blank fee is treated as zero and labeled as unspecified. The result keeps five ideas apart: quoted spread, cost versus the midprice, sweep beyond the best quote, the fee, and the fee-adjusted total.
Why a larger order consumes more than one level
Displayed liquidity is a list of prices with finite size, not a single price with infinite size. If the quantity at the best ask is smaller than the buy, the remainder prints against the next ask, then the next. The average fill moves away from the touch even when the quoted spread does not change. Depth, not the headline spread, is what sets that average.
A synthetic worked example
The preloaded book is constructed, not observed. The best bid is 99.95 and the best ask is 100.05, so the midprice is 100.00 and the quoted spread is 0.10, or 10 basis points. Total displayed size is 30 on the bid and 32 on the ask.
A buy of 10 takes 4 at 100.05 and 6 at 100.10. The completed-order VWAP is (4 × 100.05 + 6 × 100.10) / 10 = 100.08. Relative to the midprice the cost is 8 basis points. Relative to the best ask, the additional sweep is 10,000 × (100.08 / 100.05 − 1) = 2.9985 basis points, about 3 basis points. Two ask levels are consumed. The third ask, 20 at 100.20, is untouched.
| Ask | Available | Taken |
|---|---|---|
| 100.05 | 4 | 4 |
| 100.10 | 8 | 6 |
| 100.20 | 20 | 0 |
The symmetric sample reverses the picture for a sell of 10: 4 at 99.95 and 6 at 99.90. That VWAP is 99.92, also 8 basis points from the same midprice. A sell of 10 on the reference book, whose best bid is larger, is a different case: 6 at 99.95 and 4 at 99.90, VWAP 99.93, or 7 basis points versus the midprice.
When the visible book cannot fill the order
If the same reference buy were 40 instead of 10, the ask side would still contain only 32. The result would report insufficient depth, 32 filled and 8 unfilled. The average of those 32 units is 100.15625. That number is partial-book arithmetic. It is not a VWAP for an order of 40, and the page does not extend the book in order to manufacture a full-order cost. Displayed quantity can also vanish before a real order arrives. A full arithmetic fill is not a guarantee.
Limits of the labels and the inputs
Base and quote names are labels. Entering BTC and USDT does not convert one into the other. A pasted foreign-exchange rate is rejected rather than applied. Use Western digits and a dot. Persian digits, a thousands comma, NaN, and infinity are rejected rather than repaired. Fees above 100 percent are rejected. Calculations use exact rational arithmetic; a figure may be rounded only when it is printed.
Related notes and research
- Liquidity in Fragmented Markets — depth, venue access, and why a sweep estimate is not a fill.
- Market Structure & Microstructure — the displayed price and the executable price are not the same object.
- OTC Execution in Practice — a public book is one way to source size. A bilateral quote negotiated between two parties is another, with different terms. It is not the two-sided displayed book.
- Trading Infrastructure & AI — a calculator is only as current as the book someone pastes into it.
- Iran Digital Asset Liquidity & Execution Pilot — a separate 30-minute study of public order books. Its findings are observations from that window, not inputs to this synthetic tool.
The same simulator is published in Persian at شبیهساز اجرای دفتر سفارش. Arabic and Turkish editions of this tool are not published.