Portfolio Construction

One optimizer API, every asset class, no look-ahead.

MAPO wraps established open-source optimizers behind one interface and adds native solvers where they fall short (exact max-Sharpe under real constraints, CVaR LP, hierarchical risk parity, and Black-Litterman), plus a walk-forward backtester with no look-ahead.

Exact where it counts.

  • Max-Sharpe as an exact homogeneous SOCP, valid under box, asset-class, and turnover constraints together, where heuristic rescaling quietly breaks.
  • CVaR LP from Rockafellar-Uryasev: minimize tail loss or cap it while maximizing return, at any confidence level.
  • HRP and HERC with López de Prado seriation and ERC-refined splits: millisecond numpy implementations, with constraint projection when the hierarchy must respect caps.
  • Black-Litterman with full He-Litterman and Idzorek view-uncertainty control.

Real portfolio rules, first-class.

  • Asset-class caps (crypto ≤ 10%, futures ≤ 20%), per-asset bounds, turnover limits against previous weights, cash buffers, leverage caps.
  • Convex rules compile to cvxpy; hierarchical weights get a projection repair operator instead of being ignored.
  • A unified optimize(returns, cov, prev_weights) signature: swap native, PyPortfolioOpt, skfolio, or Riskfolio backends on identical inputs and compare weights directly.

Backtests that respect the calendar.

  • Walk-forward evaluation with monthly rebalancing and explicit cost basis in basis points. No in-sample shortcuts.
  • Default 28-asset universe across five classes, with parquet-cached fetching and a deterministic synthetic generator for offline tests.
  • Risk measures vectorized end to end: VaR and CVaR (historical, Gaussian, Cornish-Fisher), drawdown and Ulcer series, tracking error.