ToolsCharitable-Giving Optimizer

Charitable-Giving Optimizer

The list of appreciated lots whose donation maximizes capital-gains tax avoided.

Input
Portfolio + dollar gift target
Output
Lot-level donation list
Tax effect
Embedded gain not realised by donor
Headline resultIllustrative
$43,860

Capital-gains tax avoided

The idea

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.

The objective
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.

What goes in, what comes out
Inputs
  • Portfolio with lot-level cost basis
  • Dollar gift target
  • Optional: TE preservation cap
Outputs
  • Donation lot list (ticker, share count, embedded gain)
  • Capital-gains tax avoided (donor view)
  • Resulting portfolio TE vs. benchmark
Worked example

$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.

Input

Gift target

Default · $250,000

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.

How the optimizer applies it

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.

The trade-off

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.

Other tools

Educational calculator. Output is illustrative and is not investment or tax advice.