Basic Prerequisites: None. (For the impact-model view, Market Impact & Depth.)


1. Intuition & Practical Objective

You want to sell 1,000,000 shares of a stock trading at $50. Your position is worth $50m. The screen says $50.00. You cannot get $50.00. Try to sell the whole block in one click and you sweep every bid down to $49.50 - you collect maybe $49.7m. Work the order over three weeks and the price may drift anywhere, and the position is a $50m bet you did not intend to hold. That is the entire problem in one paragraph.

This page builds the why with no prior math needed. Three ideas carry the whole subject:

  1. The cost of speed is market impact. Pushing size into a book of finite depth moves the price against you. The harder you push, the worse each incremental share fills. Impact is the rent you pay for immediacy.

  2. The cost of patience is timing risk. While you still hold shares, the market moves. Volatility doesn’t care about your intentions. Holding inventory is taking a position.

  3. They trade off, and the trade-off has an optimum. Cost falls with time; risk rises with time. There is a schedule that is best for your risk appetite - and for a linear impact model it is a specific, known curve (a decaying exponential, in continuous time).

Everything else in this folder is the mathematics of that third point.

The one-sentence essence. “Selling fast costs impact, selling slow costs risk; the optimal schedule spends exactly as long as your risk aversion says is worth it.”


2. Mathematical Ground Truth & Derivations

The two cost curves. For a constant-rate (“TWAP”) liquidation of shares over a horizon :

  • Impact cost is paid on the trade rate. Total expected cost falls as :

where is the temporary-impact coefficient, the permanent one, and is a constant that does not depend on the schedule at all (it is paid whichever way you trade).

  • Risk is the standard deviation of the trading revenue, driven by holding inventory :

Choosing a horizon. With risk aversion (dollars of variance you will pay to save a dollar of expected cost), minimize :

The quantity is the half-life of the trade (time to deplete the position by a factor ) and is the urgency. Note what does not appear: and itself. With linear impact, every basket of the same stock is liquidated on the same intrinsic time scale - a counter-intuitive but exact consequence of cost and variance both scaling as (Almgren–Chriss 2000, §2.3).


3. Computational Implementation - the trade-off in numbers

The whole argument on one screen: for a TWAP liquidation, compute impact cost, risk standard deviation, and the utility as a function of the chosen horizon. Stdlib only.

Read down the columns: impact cost falls as , risk sd rises as , and the sum has a clean interior minimum. The analytic optimum days sits inside the grid’s best (). That U-shaped curve is optimal execution.


4. Failure Modes & First-Principles Breakdowns

  1. “Just sell it all now” is not free. Setting sends impact cost while risk . The minimum-variance schedule is a pure block - and it is the most expensive possible schedule. There is no schedule with zero cost.
  2. “Just wait for a good price” is also not free. Setting makes impact negligible but leaves the full position exposed to a random walk. The risk term grows without bound. Patience is a position.
  3. The half-life is a property of the stock, not the order. With linear impact, does not contain . Big baskets are not automatically traded slower - this is the linear-impact assumption talking, and it is precisely what 05 - Failure Modes breaks with nonlinear impact.
  4. The cost split confuses beginners. Permanent impact contributes only the constant - it is paid regardless of schedule. Only temporary impact and risk are optimizable. Missing this leads people to “optimize” a term that cannot move.

5. References

  • Almgren, Robert; Chriss, Neil - “Optimal execution of portfolio transactions,” Journal of Risk 3(2), 5-40 (2000)
  • Hasbrouck, Joel - Empirical Market Microstructure (2007)
  • Perold, André F. - “The implementation shortfall: Paper versus reality,” Journal of Portfolio Management 14(3), 4-9 (1988). The benchmark this whole folder is graded against.

6. Connected Graph Bridges