Charitable-Giving Optimizer
The list of appreciated lots whose donation maximizes capital-gains tax avoided.
Capital-gains tax avoided
Of the lots in your portfolio, this picks the ones with the biggest embedded gains to give away — so the gift dollars come pre-loaded with the most tax-savings.
Maximize Σ gain_i · donate_i, subject to: 0 ≤ donate_i ≤ holding_i and TE_after ≤ TE_target.
The tool solves this on demand against a portfolio snapshot — typically in a single CVXPY call, or a short loop for multi-period tools. Unlike a strategy, there is no daily-rebalance schedule; you re-run when the inputs change.
- Portfolio with lot-level cost basis
- Dollar gift target
- Optional: TE preservation cap
- Donation lot list (ticker, share count, embedded gain)
- Capital-gains tax avoided (donor view)
- Resulting portfolio TE vs. benchmark
$10M direct-indexing account; $250k gift target; TE cap 50 bp; long-term gains rate 23.8%.
- Lots flagged for donation
- 9 (out of 612)
- Total gift FMV
- $251,200
- Embedded gain in those lots
- $184,300
- Capital-gains tax avoided
- $43,860
- Post-gift TE vs. benchmark
- 31 bp
Targeting the nine highest-embedded-gain lots clears 73% of the gift's dollar value as untaxed appreciation. Numbers are illustrative.
Gift target
The dollar value of stock the optimizer is asked to nominate for donation. The output is the specific lots that together hit this target with the largest embedded gain.
The constraint enters as an equality on the dollar value of donated lots. The optimizer picks the slate that hits the target exactly while maximising the embedded gain inside it.
A larger gift target unlocks more tax savings but shifts the residual portfolio further from the benchmark (more lots removed). A smaller target preserves the residual but caps the savings.
A phased realization schedule for moving a portfolio toward a benchmark under a tax budget.
Late-year harvesting. Maximizes realized losses through year-end while capping gains to zero.
Educational calculator. Output is illustrative and is not investment or tax advice.