Quant Analytics: from scratch to pro · Microstructure, execution and costs · Advanced
Execution: TWAP, VWAP and implementation shortfall
Getting a large order done is a trade-off between paying impact by rushing and carrying price risk by waiting. Implementation shortfall measures the full cost against the decision price, and simple schedules such as TWAP and VWAP are the usual way to spread an order.
In this lesson
- Compute implementation shortfall and split it into execution, opportunity and fee components
- Compute TWAP and VWAP and say what each benchmark misses
- Explain the trade-off between impact cost and price risk in the Almgren-Chriss framework
- Choose a benchmark that matches the question being asked
Read first: Slippage and market impact: the square-root rule
A decision to trade is not a trade. Between the decision and the last fill, the market moves, and the order itself moves it. Execution is the craft of managing that gap, and implementation shortfall is the measure that keeps the whole gap in view.
Implementation shortfall
Perold (1988) compared two portfolios: a paper one, traded entirely at the decision price with no cost, and the real one. The difference is the implementation shortfall. For a buy it is the paper gain minus the real gain. It has three parts:
- Execution cost: filled shares times the gap between the average fill and the decision price.
- Opportunity cost: unfilled shares times the price move since the decision.
- Fees: commissions and charges.
Slippage against the decision price, delay, impact and missed fills are all inside it. See implementation shortfall.
Worked example
You decide to buy 10,000 shares when the price is 50.00. The order fills 6,000 at 50.10 and 3,000 at 50.20, a total of 451,200, so the average fill is 50.1333. The last 1,000 shares do not fill, and the price ends the day at 50.50. Fees are 0.01 a share on the 9,000 filled.
- Execution cost:
9,000 x (50.1333 - 50.00), which is 1,200. - Opportunity cost:
1,000 x (50.50 - 50.00), which is 500. - Fees: 90.
- Shortfall: 1,790, or 35.8 basis points of the paper trade.
Check it from the portfolios. The paper gain is 10,000 x 0.50, which is 5,000. The actual gain is 9,000 x 50.50 - 451,200 - 90, which is 3,210. The difference is 1,790 again. Note that the unfilled part is a cost only because the price rose; if it had fallen, missing it would have been a gain.
TWAP and VWAP
TWAP (time-weighted average price) averages the price across equal time slices. As a schedule it trades equal amounts per slice. VWAP (volume-weighted average price) weights each price by the volume traded at it.
Take five intervals with prices 50.10, 50.15, 50.30, 50.20, 50.25 and volumes 100, 200, 400, 200, 100. The TWAP is 50.20. The VWAP is 50.225. They differ by 4.98 basis points because most volume traded when the price was higher.
VWAP is a fair yardstick for an order that must follow the market's own rhythm. Both benchmarks share a flaw: they start when the order starts. They cannot see the cost of a delay before the first fill, or of orders left unfilled. A trader who waits all morning and then fills at VWAP looks perfect against VWAP and poor against implementation shortfall.
Cost against risk
Almgren and Chriss (2000) formalised the trade-off. Trading fast pays more impact. Trading slowly leaves the unsold position exposed to price moves. In a simple version with linear temporary impact, the expected cost of selling X shares over T days is eta x X^2 / T, and the standard deviation of the price outcome for a steady schedule is sigma x X x sqrt(T / 3).
With 100,000 shares, eta = 5e-6 and a daily price volatility of 1.00:
| Horizon | Expected impact cost | Risk (1 st. dev.) |
|---|---|---|
| 1 day | 50,000 | 57,735 |
| 5 days | 10,000 | 129,099 |
Five days cuts the expected cost by a factor of five and raises the risk by a factor of 2.24. Which point is right depends on how much risk the trader is willing to carry for each unit of cost saved. There is no best horizon without that choice.
Common mistakes
- Judging execution only against VWAP or the closing price.
- Ignoring the unfilled part of an order.
- Measuring slippage from the first fill and not from the decision.
- Using a linear impact model for large orders. See slippage and market impact.
- Comparing costs across days without adjusting for volatility.
In practice
Record the price at the decision, every fill, the fees and the closing price, so the shortfall can be split and tracked. Compare it with a model of expected cost, and investigate persistent gaps. Analytics on FinUties applies measures like these to the markets it covers, so they are at hand when you read a chart. The costs in a backtest lesson covers how to carry these costs into testing.
Selling 100,000 shares: expected cost and risk against horizon
- expected impact cost
- risk (1 standard deviation)
Worked numbers
Each result is recomputed from the formula shown.
| What | Formula | Result |
|---|---|---|
| cost of the filled shares | 6000 * 50.10 + 3000 * 50.20 | 451,200 |
| average fill price | fill_cost / 9000 | 50.1333 |
| execution cost | 9000 * (avg_fill - 50.00) | 1,200 |
| opportunity cost on unfilled shares | 1000 * (50.50 - 50.00) | 500 |
| fees at 0.01 a share | 9000 * 0.01 | 90 |
| implementation shortfall | exec_cost + opp_cost + fees | 1,790 |
| shortfall in basis points of the paper trade | shortfall / (10000 * 50.00) * 10000 | 35.8 basis points |
| paper gain at 50.50 | 10000 * (50.50 - 50.00) | 5,000 |
| actual gain after fees | 9000 * 50.50 - fill_cost - fees | 3,210 |
| TWAP of five intervals | (50.10 + 50.15 + 50.30 + 50.20 + 50.25) / 5 | 50.20 |
| VWAP of five intervals | (50.10 * 100 + 50.15 * 200 + 50.30 * 400 + 50.20 * 200 + 50.25 * 100) / 1000 | 50.225 |
| TWAP below VWAP in basis points | (vwap - twap) / vwap * 10000 | 4.98 basis points |
| expected impact cost, one day | 5e-6 * 100000 * 100000 / 1 | 50,000 |
| expected impact cost, five days | 5e-6 * 100000 * 100000 / 5 | 10,000 |
| price-risk standard deviation, one day | 1.00 * 100000 * sqrt(1 / 3) | 57,735 |
| price-risk standard deviation, five days | 1.00 * 100000 * sqrt(5 / 3) | 129,099 |
Check yourself
A decision to buy 10,000 shares at 50.00 fills 9,000 at an average of 50.1333. What is the execution cost?
9,000 x (50.1333 - 50.00) = 1,200. This is the cost on the shares that filled.
The remaining 1,000 shares were never bought and the price ended at 50.50. What is the opportunity cost?
1,000 x (50.50 - 50.00) = 500. It is the gain missed on the unfilled part. It is a cost when the price moves in the direction of the trade.
Why can an order beat VWAP and still have a large implementation shortfall?
VWAP is the average price of the day. If the market has already moved away from the decision price before the order starts, even a perfect VWAP fill carries a large shortfall.
In a linear-impact model, selling over five days instead of one cuts expected impact cost by what factor, and what grows?
Expected cost is eta x X^2 / T, so it falls by a factor of 5. The risk of price moves while holding the unsold part grows, here by sqrt(5 / 1) = 2.24 times.
Key terms
Sources
- The Implementation Shortfall: Paper versus Reality. The Journal of Portfolio Management 14(3), 4-9 (André F. Perold), 1988. Accessed 9 Nov 2026
- Optimal execution of portfolio transactions. Journal of Risk 3(2), 5-39 (Robert Almgren, Neil Chriss), 2000. Accessed 9 Nov 2026
- Trades, Quotes and Prices: Financial Markets Under the Microscope. Cambridge University Press (Jean-Philippe Bouchaud, Julius Bonart, Jonathan Donier, Martin Gould), 2018. Accessed 9 Nov 2026
- Trading and Exchanges: Market Microstructure for Practitioners. Oxford University Press (Larry Harris), 2003. Accessed 9 Nov 2026