Lot-aware rebalancing with realized gain budget · Calculation guide

Estimate how many shares of one security can be sold within a realized-gain budget.

Calculation guide

Sell whole shares up to the desired trim, highest basis first. Realized losses offset realized gains in this scenario. A single sale price applies. Ignore jurisdiction-specific tax-lot restrictions, taxes and fees.

Per-share gain = sale price − lot basis. Fill lower-gain lots first subject to share and net gain limits.

Inputs

Sale price per share

Example entry 100 (in the selected currency).

Desired shares to sell

Example entry 15. Use whole numbers.

Maximum net realized gain

Example entry 110 (in the selected currency).

Whole shares available

Example entry 10. Allowed range 1 to 1000000000.0. Use whole numbers.

Cost basis per share

Example entry 70 (in the selected currency).

Worked example

InputValue
Sale price per share100
Desired shares to sell15
Maximum net realized gain110

Tax lots of the same security

Whole shares availableCost basis per share
1070
1095
ResultValue
Whole shares sold12
Gain · Realized110
Gross sale proceeds1,200
Desired sales left unfilled3

How each input affects this example

Each row starts from the worked example and changes one input.

InputOriginal inputNew inputAffected resultOriginal resultNew result
Sale price per share100110Whole shares sold127
Desired shares to sell1517Desired sales left unfilled35
Maximum net realized gain11099Whole shares sold1211
Whole shares available (row 1)101Whole shares sold1211
Cost basis per share (row 1)7077Gain · Realized11096
Lot-aware rebalancing with realized gain budget →