Explain limit order book price impact. Market buy walks the book consuming liquidity at increasing prices. Calculate VWAP of execution versus mid-price.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
My 5,000-share order fills progressively across price levels: 2,000 shares at 100.20,then1,500at100.25, followed by 1,000 at 100.30,andfinally500at100.35. This totals 501,250acrossallfills.Thevolume100.25 per share, which represents the actual execution price I received despite the mid-price being $100.10 before my order.
The market's initial mid-price sits at 100.15(averageofthe100.10 bid and 100.20ask).Myexecutionat100.25 creates a 10 basis point impact relative to this mid-price. This impact splits into two components: 5 basis points from crossing the bid-ask spread itself, and another 5 basis points from walking through the order book as my large order consumes available liquidity at progressively worse prices.
Price Impact ∝ √(Q/V) * σ
The square root relationship shows that impact doesn't scale linearly with order size—a 4x larger order doesn't create 4x the impact, but rather 2x. The linear model offers a simpler framework where execution price moves proportionally with quantity, while the logarithmic approach captures how impact depends on the ratio of my order to daily volume.
To illustrate these concepts, consider executing 10,000 shares against an order book with the mid at 100.Theasksideshowsliquiditytieredfrom100.05 up to 100.05, then 2,500 at 100.15 and 1,500 at 100.25. The total execution cost reaches $1,001,250, which I can use to calculate realized spread and other impact metrics.
The volume-weighted average price comes to 100.1250pershare.Sincethemid−pricebeforeexec100.00, the implementation shortfall—the difference between what I paid and the reference price—totals $1,250 or 12.5 basis points. Comparing this to the bid-ask spread of 10 basis points shows the market impact exceeded the spread itself by a factor of 1.25, indicating the large order moved prices meaningfully beyond the initial spread width.
Several variables drive how much prices move. Larger orders naturally push prices further, as do periods of high volatility when dealers widen their spreads due to uncertainty. The size relative to typical trading volume matters significantly, as does execution urgency—a must-fill order creates more impact than a patient approach. Dealer inventory also plays a role; if market makers are already holding excess stock, they'll widen spreads to discourage additional selling. On the flip side, deeper liquidity, higher market volume, and more competing market makers all reduce impact. Better information availability also tightens spreads and lowers the cost of execution.
To measure this practically, I can calculate the VWAP and resulting price impact by walking through an order book. The function takes an order quantity and the available liquidity at each price level, executing against the book sequentially. It then computes the volume-weighted average price paid, compares it to the mid-price at arrival, and expresses the difference in basis points to quantify the actual market impact incurred.
Running this with a 5,000 share order against the sample book shows the VWAP, the reference mid-price, and the total impact in basis points. Beyond the mechanical calculation, I should distinguish between temporary impact—the immediate spread widening as the order consumes liquidity—and permanent impact, where the mid-price itself shifts due to information or inventory effects. The temporary component typically recovers as market makers refresh, while permanent impact reflects a lasting change in fair value.
To minimize impact, I'd consider VWAP execution to align with natural volume patterns throughout the session, or TWAP to distribute the order evenly over time.
For larger orders, smart order routing across venues combined with iceberg orders—revealing size gradually—helps limit the market's reaction. Participation-weighted strategies that account for historical volume patterns tend to outperform simple time-based splits.
For a concrete scenario: buying 50,000 SPY shares with a mid of 450.00,tight1.1bpspread,and50M daily volume. The key is balancing urgency against market impact—aggressive execution moves the price more, while patient execution risks missing favorable conditions. Execution VWAP: $450.12
Impact: 12 cents = 26.7 bps (% impact = 0.0267%)
Dollar Cost: $13,400
Using the square root rule as a benchmark, with Kyle's lambda at 0.025, the theoretical impact comes to roughly 7.9 bps. The actual realized impact of 26.7 bps significantly exceeds this model estimate, suggesting the order faced greater market resistance than the formula would predict.
The discrepancy stems from practical constraints: the order book only has 30,000 shares at the best price despite $15M in total depth, forcing execution into progressively worse levels. The model assumes unlimited supply at each price tier, whereas real markets have discrete liquidity pockets and information effects that amplify costs when large orders walk the book.
I've covered the essential teaching components—from order book structure and VWAP mechanics through price impact quantification, theoretical frameworks, implementation examples, and real-world constraints. The numerical walkthrough demonstrates how a seemingly small order can incur meaningful costs when it exhausts available liquidity at favorable prices.
Limit Order Book Price Impact
Core Mechanics
When a market buy walks the book, it consumes liquidity at progressively worse prices, creating measurable price impact.
Order Book Structure
BID SIDE ASK SIDE (Sell Orders)
Price Size Price Size
$100.30 1,000
$100.25 1,500 ← Progressively worse prices
$100.20 2,000 ← Best ask
$100.10 1,000