Build a complete portfolio optimization tool using CVXPY. Construct efficient frontiers, handle real-world constraints, implement robustness techniques, and produce a defensible allocation decision.
optimization · cvxpy · portfolio · efficient-frontier · quant
Learners placed at Morgan Stanley NYC · Optiver AMS
A real portfolio optimizer, built section by section - hands-on, but never alone. Theory first, then you implement it, and checkpoints confirm each section clicked before the next one opens.
Section 0
The Quant Task and the Objects
objects.py
Section 1
Minimum Variance Portfolio
min_variance.py
Section 2
Efficient Frontier via Target Returns
frontier.py
Section 3
Efficient Frontier via Risk Aversion
risk_aversion.py
Section 4
Real-World Portfolio Constraints
constraints.py
Section 5
Robustness and Numerical Stability
robustness.py
Section 7
Final Integration and Quant Decision
recommend.py
Never stuck
Reveal a hint when you want a nudge - or the full worked solution when you want the answer. Every exercise ships one.
Theory before code
Each formula is explained step by step before you implement it. Nothing is assumed mid-build.
Yours to keep
Finish with the complete research notebook - keep extending it with your own data.
Section 0The Quant Task and the Objects
3 tasks · 2 questions
Section 1Minimum Variance Portfolio
2 tasks · 5 questions
Section 2Efficient Frontier via Target Returns
2 tasks · 3 questions · 1 demo
Section 3Efficient Frontier via Risk Aversion
2 tasks · 3 questions
Section 4Real-World Portfolio Constraints
3 tasks · 4 questions
Section 5Robustness and Numerical Stability
2 tasks · 3 questions
Section 6Cardinality Constraints (Optional Deep Dive)
Reading
Section 7Final Integration and Quant Decision
1 task · 1 question
FinishProject Complete
Your rewards
Real code from inside the project. Press Run to search 5,151 portfolios for the best Sharpe - by brute force. Open this page on desktop to run it live in your browser.
import numpy as np
mu = np.array([0.06, 0.10, 0.13]) # bonds, equities, alternatives
vol = np.array([0.10, 0.16, 0.22])
corr = np.array([[1.0, 0.3, 0.2], [0.3, 1.0, 0.5], [0.2, 0.5, 1.0]])
cov = np.outer(vol, vol) * corr
# Brute-force the long-only simplex: every 1% mix, 5,151 portfolios.
grid = [(a, b, 100 - a - b) for a in range(101) for b in range(101 - a)]
W = np.array(grid) / 100
sharpes = (W @ mu) / np.sqrt(np.einsum('ij,jk,ik->i', W, cov, W))
best = W[sharpes.argmax()]
eq = np.ones(3) / 3
eq_sharpe = (eq @ mu) / np.sqrt(eq @ cov @ eq)
print(f"equal weight Sharpe : {eq_sharpe:.3f}")
print(f"optimised Sharpe : {sharpes.max():.3f}")
print(f"best mix : {best[0]:.0%} bonds / {best[1]:.0%} equities / {best[2]:.0%} alts")The full build replaces brute force with convex optimization and real-world constraints.
Resume bullets
Copy-paste ready - with the build behind you to back every line.
3 more resume bullets inside the project
Interview ammo
“Explain why the covariance matrix is the key input and how estimation error affects results”
You answer this with a system you built, not a definition you memorized.
5 more talking points inside the project
Full access to this build and the rest of the pipeline - every project in the vault, plus the lessons, exams and certificates behind them. Guided from the first line to the last.
~12h build · +400 XP · 4 resume bullets · 6 interview answers