liveBook · Manning

Substantially identical instrument

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

A substantially identical security is an investment security considered equivalent to another security for applicable tax-law purposes.

A substantially identical instrument is a security treated as equivalent to another for applicable tax-law purposes. The distinction matters in tax-loss harvesting: replacing a security with one that is too similar can create a wash sale and affect the associated tax loss. section 14.4.2 section 14.2.2

Choosing a replacement ETF

SPY, IVV, and VOO all track the S&P 500, so they may be considered substantially identical. By contrast, PBUS and VTI can differ in trading cost, liquidity, index breadth, and holdings; how similar is enough remains an investor judgment. section 14.4.2

Automated wash-sale checks can represent different tickers as disjoint sets of instruments considered substantially identical. For each set, the process checks recently purchased lots, loss status, holdings, and blocking lots before approving sales or purchases. section 14.2.2

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

How deep it goes
Defines the tax distinction and implements lot-level eligibility checks, but leaves the threshold for sufficient similarity to the investor.
Examples
Compares SPY, IVV, VOO, PBUS, and VTI, then tests ticker-level and grouped-instrument restrictions with Python tax-lot data.
What it assumes
Assumes tax-lot and wash-sale concepts, while introducing instrument grouping through concrete ETF comparisons and executable checks.
What you can do after
Diagnose wash-sale restrictions with Python by grouping equivalent instruments and identifying blocked purchases or sales.
How it connects
Connects substantially identical instruments to wash sales, tax-loss harvesting, tax lots, cost basis, and exchange-traded funds.

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.