Quant interview toolkit · market depth

The best ask is £100.01. Your 700-share buy will not cost £100.01

A trading screen shows a £100.00 midpoint and a best ask of £100.01. A buyer wants 700 shares immediately. Quoting the £100.01 ask for all 700 shares grants 500 shares of liquidity that are not sitting at that price. The cost of immediacy lives in the depth of the book.

Walk the displayed levels

Assume a static toy ask book: 200 shares at £100.01, 300 at £100.02, and 500 at £100.05. A 700-share marketable buy takes all of the first two levels and 200 from the third. Its cash paid is

200(100.01)+300(100.02)+200(100.05)=£70,018.200(100.01)+300(100.02)+200(100.05)=£70{,}018.

The volume-weighted average execution price is £70,018/700 = £100.025714…. Relative to the £100.00 midpoint, that is about 2.57 basis points of cost. The best ask alone was one basis point above mid. The extra 1.57 bp comes from walking to more expensive levels.

For qq shares with prices pip_i and executed quantities qiq_i, the general calculation is

VWAP⁡fill=∑iqipiq,cost in bp=10,000(VWAP⁡fillm−1),\operatorname{VWAP}_{\rm fill}=\frac{\sum_i q_i p_i}{q}, \qquad \text{cost in bp}=10{,}000\left(\frac{\operatorname{VWAP}_{\rm fill}}{m}-1\right),

where mm is the chosen benchmark midpoint and ∑iqi=q\sum_i q_i=q. The numerator uses fill quantities, not posted quantities that were not reached.

Why size changes the answer

For 100 shares, the entire order fills at £100.01 and the toy cost is 1 bp. At 500 shares, the average price is (200(100.01)+300(100.02))/500=£100.016(200(100.01)+300(100.02))/500=£100.016, or 1.6 bp above mid. At 1,000 shares, all visible depth is consumed and cost reaches 3.3 bp. The relationship is piecewise: within a price level, the marginal cost is constant; crossing a depth boundary creates a kink.

This is a snapshot calculation. In a live book, displayed orders can cancel, hidden liquidity can execute, another trader can arrive first, and the midpoint can move during the order. The eventual slippage should be compared with a decision-time benchmark as well as arrival and fill prices. The slippage-dashboard article explains why ticket-weighted and notional-weighted summaries can tell very different stories.

Turn the snapshot into a risk check

A useful pre-trade estimate asks how much of the order fits at each level and how often that depth is available when the strategy sends orders. Replay the actual order size distribution against historical books; do not price every trade at a median book. The worst trades may coincide with sparse depth and volatile prices, exactly when signals are strongest. Simulate both a static sweep and slower execution with price movement, then include fees and any exchange rebates separately.

The marginal share is the expensive one

At 700 shares, the last 200 all execute at £100.05. If the desk increases the order to 800 shares while the snapshot remains unchanged, those additional 100 also cost £100.05 each. Average cost rises, but by less than the last share’s five-basis-point premium because the cheaper shares still contribute to the average. This distinction between average and marginal price matters when a strategy decides whether the next unit of position is worth acquiring.

The toy book also has only 1,000 displayed shares. Asking what a 1,200-share market order will cost requires information beyond the pictured levels. A model that silently repeats the last price or assumes infinite depth has inserted a liquidity assumption. Make that assumption visible, stress it, and compare it with actual fill records before sizing the trade.

A market buy walks the visible ask book

Average cost above £100 mid (bp)

Toy asks: 200 shares at £100.01, 300 at £100.02, 500 at £100.05. No replenishment or hidden liquidity.

Practice

Five hundred sharesWhat is the VWAP and midpoint cost for a 500-share buy in the toy book?
Show answer
VWAP is £100.016. Relative to a £100 midpoint, the cost is 10,000(100.016/100−1)=1.610{,}000(100.016/100-1)=1.6 bp.
Beyond the bookWhat additional assumption would you need to price a 1,200-share immediate buy?
Show answer
The displayed toy book contains only 1,000 shares. You need prices and available quantities beyond its third level, or an explicit model for new liquidity.