Tax-Aware & Constrained Optimization
Lots, wash sales, harvesting, MILP turnover, tracking-error with cardinality, risk parity.
Why this theme exists
The hard edge of rebalancing: specific-ID lot selection, wash-sale windows that span accounts and dividend reinvestments, tax-loss harvesting into partner ETFs, and formal optimization problems with verifiable optimality gaps.
Capability under test
Modeling domain rules precisely (holding periods, substantially-identical securities, cross-account wash sales) and formulating/solving optimization problems rather than hand-waving heuristics.
Design notes
Oracles use scipy/HiGHS MILP or exhaustive enumeration where tractable. Optimality gap scoring is linear between 'oracle + tolerance' and a hard floor so partial progress is visible. Rule violations are gates because in production a wash-sale violation is a compliance event, not a rounding error.
Tier ladder
- Tier 10
- Tier 21
- Tier 34
- Tier 40
| Task | Tier | Phase | Reward | Gates | Budget | Status |
|---|---|---|---|---|---|---|
| Equal risk contribution weights on an ill-conditioned covariance pf-opt-risk-parity Compute equal-risk-contribution weights for a given covariance matrix to tight tolerance and verify risk contributions. | T2 medium | Rebalance | partial | — | 15 min | ready |
| Minimum-turnover trade list restoring all bands (MILP with semi-continuous trades) pf-opt-min-turnover-milp Solve the minimum-turnover trade list that brings every sleeve within bands under whole-share and cash constraints, verified by optimality gap against a MILP oracle. | T3 hard | Rebalance | multi-metric | 1 gate | 40 min | ready |
| Tracking-error minimisation with Ledoit–Wolf covariance and a cardinality cap pf-opt-tracking-error-cardinality Select at most five ETFs and weights minimising ex-ante tracking error to a benchmark composite using a Ledoit–Wolf covariance, with an optimality-gap check. | T3 hard | Rebalance | multi-metric | — | 40 min | ready |
| Tax-loss harvesting into partner ETFs with exposure and wash-sale guards pf-tax-loss-harvest-swap Identify and execute tax-loss harvests into designated partner ETFs while maintaining sleeve exposure and respecting the wash-sale window in both directions. | T3 hard | Rebalance | multi-metric | 1 gate | 40 min | ready |
| Specific-ID lot selection minimising tax with cross-account wash-sale rules pf-tax-lot-selection-wash-sale Choose specific tax lots for a required sell list to minimise tax cost under short/long-term rates while avoiding wash-sale violations against recent and planned purchases across all accounts. | T3 hard | Rebalance | multi-metric | 1 gate | 40 min | ready |