Case 098Compliance, risk limits and conductHard
Formulate the portfolio optimisation for a 40-stock fund: maximise expected return minus a risk penalty, with no stock above 10%, no sector above 30% and one-way turnover under 15% a month. Solve a four-stock version by hand and show which constraint binds.
1The situation
Ganitika Asset Management, an invented fund house, is building a quantitative equity fund of about 40 stocks. The investment committee wants the optimisation written down before it is coded: the objective, every constraint, and a worked example small enough to check by hand. The rules are a 10% cap on any single stock, which also reflects the regulatory single-issuer limit for equity schemes (confirm the current figure), an internal cap of 30% on any sector, and one-way turnover of no more than 15% of NAV a month.
For the hand-worked version use four stocks with expected returns of 15%, 13%, 10% and 8%, each with 20% volatility and no correlation between them, a risk aversion of 2.5, and caps scaled to the small problem: 40% a stock and 60% for the sector that stocks A and B share. The fund currently holds 20%, 20%, 30% and 30%.
2Your task
Write the objective and constraints, solve the four-stock problem step by step, identify which constraint binds and what it costs, and show how the turnover rule changes what gets traded this month.
Quick check
In the four-stock example, which constraint ends up shaping the final weights?
Worked solution
Try it on paper, then open one step at a time.
30-second answerThe answer to give first
Maximise forecast return less a risk penalty, subject to a budget, no shorting, a 10% stock cap, a 30% sector cap and 15% monthly turnover; in the four-stock version the sector cap binds. Unconstrained, the weights are 42.5, 32.5, 17.5, 7.5%. The 40% stock cap trims A, but the sector cap on A plus B, which want 75%, is what sets the answer: 35, 25, 25, 15%, costing about 0.75 points of expected return. From today's book the move needs 20% of buys, so the 15% turnover rule splits it over two months.
Step 1What does the problem look like written down?
A shopping list with a budget and house rules. You want the most nutrition for the money, you cannot spend more than you have, you cannot buy negative rice, no single item may take over the trolley, and you do not swap the whole trolley every week. The objective is expected return minus a risk penalty: the sum of each stock's forecast times its weight, less a risk aversion number times the portfolio's variance. The constraints are the fences: weights sum to one and none is negative; no stock above 10% of NAV, which also keeps the fund inside the regulatory single-issuer limit, to be confirmed; no sector above 30%; and the sum of buys in a month no more than 15% of NAV. The forecasts come from research; the fences come from the mandate, the regulator and the dealing desk.
| μ | vector of expected returns from research |
| w | portfolio weights to be chosen |
| λ | risk aversion, here 2.5 |
| Σ | covariance matrix of returns |
| w⁰ | current weights, so the last term is one-way turnover |
Step 2How do you solve the four-stock version by hand?
With equal variances and no correlation the penalty is 2.5 x 0.04 x the sum of squared weights, and the first-order condition says each weight is (forecast minus a common hurdle) divided by 0.2, with the hurdle set so the weights sum to one. Unconstrained, that gives A 42.5%, B 32.5%, C 17.5% and D 7.5%, an expected return of 12.95%. A breaches the 40% cap. Fix A at 40% and re-solve the other three over the remaining 60%: B 33.3%, C 18.3%, D 8.3%. Now A plus B is 73.3%, over the 60% sector cap, so the sector constraint is the one that matters.
Enforce it by solving two problems: 60% split between A and B with their own hurdle, and 40% between C and D with theirs. That gives A 35%, B 25%, C 25% and D 15%; A is now below 40%, so the single-stock cap has gone slack and only the sector cap binds. The two hurdles differ by 3 percentage points of return, which is the shadow price of the sector cap: relaxing it by one point of weight would add about 0.03 points of objective. Expected return falls from 12.95% to 12.20%, the price of the fence. A brute-force check over every weight combination in 1% steps confirms these are the best weights under both caps.
| Stage | A | B | C | D | A + B | Expected return |
|---|---|---|---|---|---|---|
| Unconstrained | 42.5% | 32.5% | 17.5% | 7.5% | 75.0% | 12.95% |
| Stock cap 40% | 40.0% | 33.3% | 18.3% | 8.3% | 73.3% | 12.83% |
| Stock and sector caps | 35% | 25% | 25% | 15% | 60% | 12.20% |
Step 3What does the turnover rule change?
The route, not the destination. From today's 20/20/30/30, reaching the target needs buys of 15 points in A and 5 in B, 20% one-way, above the 15% monthly allowance. Rank the trades by what they add: the marginal gain from each stock at today's weights is forecast less 0.2 times weight, A 11, B 9, C 4, D 2 points, so the biggest gap is between A and D. Month one: buy A to 35% and sell D to 15%, exactly 15% of turnover. Month two: buy B to 25% and sell C to 25%, and the book is at target. In the real 40-stock fund the same logic runs every month: the optimiser proposes, the turnover cap rations, and the trades with the largest gap between forecast and current weight go first.
Close with what the committee should take from the example. In practice the constraints, not the forecasts, shape most of the portfolio: the forecasts said 75% in one sector and the fences said 60%, and the stock cap turned out not to matter once the sector cap was applied. That is normal. It also means the committee should spend its time on the fences, since they are the part it controls, and should ask the quant team for the shadow price of each constraint every month, because a cap that is always binding at a high price is either protecting the fund or strangling it. The limits: equal variances and zero correlation made the hand solution possible and are false in a real book, where a covariance matrix and a solver replace the closed form; forecasts carry estimation error that the optimiser will exploit, which is one more reason the caps exist.
Where candidates lose it
Candidates write the objective and list the constraints, then stop, or they solve the unconstrained problem and announce it. The interviewer wants to see a constraint bind and what it costs; a solution that lands inside every cap without touching one has not tested the fences.
The second miss is applying the stock cap and stopping there. The sector cap sits behind it, and once it is enforced the stock cap is slack; checking which constraints are active at the end is the point of the exercise.
What the interviewer asks next
- Stocks A and B have a correlation of 0.6. Which way do the unconstrained weights move, and does the sector cap still bind?
- How would you add transaction costs to the objective rather than as a turnover cap, and what changes?
- What would you do if the optimiser kept pushing every stock to its cap?
- How would you check that the forecasts are not just noise the optimiser is amplifying?
Asked at BlackRock, Quantitative Research, New York, 2025 (Wall Street Oasis): how I would formulate a portfolio optimization problem, including the objective function and practical constraints such as risk, expected return, position limits
Company names and figures are illustrative.
