plugins/wealth-management/skills/rebalancing/SKILL.md
Maintain portfolio allocations over time using calendar-based, threshold-based, and tax-efficient rebalancing strategies. Use when the user asks about when to rebalance, rebalancing bands, transaction cost trade-offs, tax-efficient rebalancing, or the rebalancing premium. Also trigger when users mention 'my portfolio drifted', 'how often should I rebalance', 'rebalancing across taxable and IRA accounts', 'volatility harvesting', 'buy low sell high automatically', or ask whether to use cash flows to rebalance.
npx skillsauth add joellewis/finance_skills rebalancingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Rebalance at fixed time intervals regardless of drift magnitude:
Calendar rebalancing is simple to implement and schedule but may miss large dislocations between dates or trigger unnecessary trades when drift is minimal.
Rebalance when any asset weight drifts beyond a defined tolerance band around its target:
Threshold rebalancing is more responsive to market dislocations and avoids unnecessary trades when markets are calm. However, it requires more frequent monitoring.
Leland (2000) derived the optimal no-trade band width as a function of transaction costs, risk aversion, and asset variance:
Band width proportional to (3 * transaction_cost / (2 * risk_aversion * variance))^(1/3)
Key intuition:
Systematic rebalancing generates a "volatility harvesting" or "rebalancing premium" through the buy-low/sell-high mechanism:
This effect is sometimes called Shannon's Demon: in a two-asset portfolio with equal expected returns but independent volatility, the constantly rebalanced portfolio outperforms buy-and-hold. The rebalancing premium is larger when:
Note: The rebalancing premium is not a free lunch — it underperforms in trending markets where winners keep winning.
Costs incurred when rebalancing that reduce net returns:
Total implementation cost = commissions + half-spread + market impact + opportunity cost
Strategies to minimize tax impact when rebalancing in taxable accounts:
Rebalancing and TLH should be planned together, not as separate trade lists:
Tax benefit = Realized loss * Marginal tax rate. For the 61-day wash-sale window, the $3,000 ordinary-income offset, replacement selection, and full TLH mechanics, see the tax-loss-harvesting skill.
When an investor has multiple account types (taxable, IRA, 401k), optimize rebalancing by:
Factors that determine optimal band width:
Use regular deposits or withdrawals to move toward target weights without explicit rebalancing trades:
The concepts above describe the what and why of rebalancing. This section covers the operational how — the step-by-step process an advisor follows to execute a rebalance for a client household.
Step 1: Aggregate Household View Assemble the complete picture across all accounts (taxable brokerage, Traditional IRA, Roth IRA, 401(k), 529, trust). Calculate the household-level allocation by summing positions across all accounts, not just individual account allocations. Many drift problems are invisible at the account level but obvious at the household level.
Step 2: Asset Location Review Before proposing trades, document which account types hold which asset classes:
If asset location is suboptimal, the rebalance is an opportunity to improve it — but only if the tax cost of repositioning is justified by the long-term tax savings.
Step 3: Drift Analysis and Trade Generation For each asset class, calculate drift from target and compare against tolerance bands (from the IPS or firm default):
Step 4: Tax-Impact Estimation For each proposed sell trade in a taxable account, estimate the tax consequence:
Step 5: Cross-Account Optimization Minimize total household tax impact by choosing where to execute each trade:
Step 6: Before/After Comparison Generate a before/after allocation comparison for advisor review and client communication:
This comparison serves as both a decision tool (does the rebalance justify its costs?) and a compliance artifact (documenting the rationale for the trades).
Step 7: Execution and Confirmation
| Formula | Expression | Use Case | |---------|-----------|----------| | Threshold Trigger | |w_actual - w_target| > tolerance | Rebalancing trigger condition | | Optimal Band Width | band ~ (3tc / (2lambda*sigma^2))^(1/3) | Leland optimal no-trade zone | | Tax-Loss Benefit | Benefit = Loss * Tax Rate | Value of harvested losses | | Transaction Cost | TC = commission + spread/2 + impact | Total rebalancing cost | | Drift | Drift_i = w_actual_i - w_target_i | Weight deviation from target | | Trade Size | Trade_i = (w_target_i - w_actual_i) * Portfolio Value | Dollar amount to trade | | Rebalancing Premium | RP ~ (1/2) * Σ w_i * sigma_i^2 - (1/2) * sigma_p^2 | Volatility harvesting estimate |
Given:
Calculate: Rebalancing trigger and required trades
Solution:
Check drift:
Target dollar amounts:
Required trades:
Proceeds from equity sales fund the bond purchases. In a taxable account, check the cost basis of equity lots being sold to estimate tax impact before executing.
Given:
Calculate: Tax benefit of harvesting the loss
Solution:
Realized loss from sale: $10,000
Tax benefit calculation:
If the investor had no capital gains to offset:
Implementation:
Note: TLH creates a lower cost basis in the replacement security, so taxes are deferred, not eliminated. However, the time value of the tax deferral and the ability to offset gains at favorable rates makes TLH valuable.
Run with uv run scripts/rebalancing.py (the PEP 723 header resolves dependencies automatically) or with python3 scripts/rebalancing.py after pip install numpy scipy. The bare run prints a demo covering drift analysis, threshold checks, trade generation, cash flow rebalancing, transaction costs, tax-aware lot selection, Leland bands, and the rebalancing premium. Pass --verify to assert the demo outputs match this skill's worked examples (prints PASS/FAIL), or --help for an overview of the available classes. The file is primarily meant to be imported as a module (e.g., from rebalancing import DriftAnalyzer, TradeGenerator, TaxAwareLotSelector).
testing
Model, forecast, and interpret volatility using time-series models and options-implied measures. Use when the user asks about EWMA, GARCH models, implied volatility, volatility surfaces, volatility term structure, or the VIX. Also trigger when users mention 'volatility smile', 'volatility skew', 'realized vs implied vol', 'volatility risk premium', 'vol clustering', 'mean-reverting volatility', 'options pricing inputs', 'RiskMetrics', 'decay factor', or ask how to forecast future volatility for risk management.
testing
Execute a complete tax-loss harvesting workflow from candidate identification through post-harvest monitoring. Use when the user asks about finding TLH candidates, gain/loss budgeting, replacement security selection, wash-sale compliance, or harvest execution planning. Also trigger when users mention 'unrealized losses in my portfolio', 'swap ETFs for tax purposes', 'harvest losses before year-end', 'substantially identical security', 'wash-sale window', 'NIIT offset', 'loss carryforward', or ask how much tax they can save by harvesting.
testing
Maximizes after-tax returns through strategic asset location, gain/loss management, and withdrawal sequencing. Use when the user asks about asset location, Roth conversions, tax-efficient withdrawals, tax lot selection, or charitable giving with appreciated securities. Also trigger when users mention 'which account should I hold bonds in', 'tax drag', 'Roth vs Traditional', 'RMD planning', 'bracket stuffing', 'HIFO vs FIFO', or ask how to minimize taxes on investments. For tax-loss harvesting execution and wash-sale mechanics, see the tax-loss-harvesting skill.
development
Plan and track savings for specific financial goals including retirement, education, and home purchase. Use when the user asks about required savings rates, 529 plans, retirement accumulation targets, down payment planning, or goal prioritization. Also trigger when users mention 'how much do I need to save each month', 'am I on track for retirement', 'college savings', 'safe withdrawal rate', '4% rule', 'FIRE savings rate', 'catch-up contributions', 'employer match', or ask how to balance competing savings goals.