Tax-lot optimization is the practice of deciding which specific purchases of a security to sell when only part of a holding is sold. Each purchase forms a separate tax lot with its own cost basis and holding period, so the choice of lot changes the gain or loss realized. Selling the highest-cost lots first usually minimizes the gain, while selling lots that stand at a loss can create losses to offset other gains.
In the United States, the IRS default for shares is first-in, first-out unless the investor uses specific identification at the time of sale, and other lot matching methods such as average cost apply to some fund shares. Optimization also weighs the different rates on short-term and long-term capital gains, and must respect the wash-sale rule, which disallows a loss if a substantially identical security is bought within 30 days before or after the sale. Wealth managers automate it as a source of tax alpha.
Ref 1010001345