liveBook · Manning

Tax savings

As explained in Build a Robo-Advisor with Python (From Scratch)

A reduction in tax liability attributable to a deduction, exclusion, credit, or other tax-favored treatment.

Tax savings reduce a tax bill through tax-favored decisions, but their value depends on personal circumstances, account types, tax rates, holdings, costs, and timing. They are therefore best treated as estimates under explicit assumptions rather than as fixed promises. Automated analysis can use Monte Carlo simulation to estimate savings for a particular situation. section 1.2.2

A central form is tax-loss harvesting (TLH): realize a loss to offset tax currently owed, then reinvest the sale proceeds in a similar ETF so portfolio exposure does not change drastically. The immediate benefit is the applicable tax rate multiplied by the realized loss. This is usually tax deferral, not permanent elimination: selling the replacement investment later can create a larger taxable gain because its cost basis is lower. section 14.1.1 section 14.3.3

Deferring a $1,000 tax payment

An ETF bought for $100,000 falls to $95,000. At a 20% applicable tax rate, realizing the $5,000 loss produces a $1,000 tax benefit, offsetting a $1,000 tax bill and leaving $1,000 cash available to invest. Replacing the ETF preserves broadly similar exposure, but lowers basis to $95,000. If the replacement later sells for $150,000, the gain is $55,000 rather than $50,000, so the earlier benefit came from postponing tax. section 14.1.1

A harvesting decision must compare the apparent tax benefit with constraints and costs:

  • Exclude lots whose sale and replacement would create a wash sale. section 14.3.3
  • Calculate losses for sellable lots and rank them by tax benefit so the most valuable eligible losses are considered first. section 14.3.3
  • Require positive benefit after trading costs and after opportunity cost before generating a trade. section 14.3.3
  • Choose replacement ETFs carefully when several exchangeable ETFs and several loss lots are involved; buying an ETF planned for sale can itself create a wash sale. section 14.3.3

Tax-aware withdrawal sequencing can also create substantial savings during retirement decumulation. Possible approaches include spending taxable accounts first, spending retirement accounts first, withdrawing from an IRA up to a tax-bracket boundary, or making a Roth conversion while filling that bracket. Under a given set of assumptions, the best sequence can make assets last years longer, but the appropriate choice varies with the individual situation. section 1.2.2

Figure 1.1 Decumulating tax-efficiently can make your money last longer.
figure

Compare the four withdrawal sequences by how long assets last under the illustrated assumptions; the figure emphasizes that sequencing can materially change a retirement outcome. section 1.2.2

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Works through tax deferral numerically and implements lot-level harvesting checks, while deferring withdrawal-strategy details.
Examples
Uses a depreciated ETF offsetting a $1,000 tax bill and exchangeable ETF lots including VTI, ITOT, SCHB, and SPTM.
What it assumes
Assumes familiarity with taxable and retirement accounts, ETFs, tax rates, gains, losses, and cost basis.
What you can do after
Apply it via automated evaluation to rank eligible loss lots and generate trades only when net benefits remain positive.
How it connects
Connects tax savings to tax-loss harvesting, tax deferral, wash sales, withdrawal sequencing, Roth conversions, and Monte Carlo simulation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.