rsu_lot_optimize
Minimize federal and state tax on concentrated RSU divestment by choosing which vested lots to sell and in which years. Returns an optimal year-by-year sell schedule, total tax, and FIFO comparison.
Instructions
Use this when someone asks which vested RSU lots to sell first, in which years, to divest a concentrated company-stock position at the lowest computed tax: "I want to sell down half my Amazon stock with the smallest tax bill, which lots and when?". Given the vested lots (vest date, shares, cost basis), a current price, and a divest fraction, it chooses WHICH lots and WHICH sale dates minimize computed total tax to divest that many shares, using three levers: specific-lot identification (sell higher-basis lots to realize less gain, or underwater lots to harvest losses that net against gains), long-term deferral (wait past the one-year mark to convert short-term ordinary rates to long-term capital gains), and multi-year bracket spreading (split gains across 1 to 3 tax years, with in-plan capital-loss carryforward). Every sale is priced at today's price (flat-price assumption; there is no growth model). Returns the year-by-year sell schedule grouped by tax year, the total tax (federal LTCG + NIIT + state), what a first-in-first-out (FIFO) oldest-first sell order on the same schedule would have cost (headlineDeltaVsFifo), a 1/2/3-year horizon trade-off, and per-lot deferral callouts. This tool owns WHICH LOTS and WHICH DATES; for WHETHER and HOW MUCH to sell down a position use concentration_analyze, for a single new vest use rsu_sell_vs_hold, and to raise a specific cash amount by a deadline use equity_funding_plan. Out of scope: growth/return modeling, wash-sale basis migration, AMT, unvested grants. Example: {lots: [{vestDate: "2022-08-15", shares: 120, costBasisPerShare: 95}, {vestDate: "2024-02-15", shares: 100, costBasisPerShare: 130}, {vestDate: "2026-05-15", shares: 80, costBasisPerShare: 210}], currentPrice: 180, divestFraction: 0.5, horizonYears: 2, ordinaryIncome: 200000, filingStatus: "single", stateCode: "CA"}. Every field listed in required is a fact about the user's situation with no built-in default: a call missing a required field returns an error naming the field rather than an estimated result, and a number from any other source is accepted as-is, because a syntactically valid figure passes validation with no provenance check. The math runs inside the tool with no randomness and no model inference. Results from multiple OptionsAhoy tools in one analysis are independent single-position calculations; integrated multi-year, multi-position optimization is available in the OptionsAhoy beta at optionsahoy.com/beta?src=mcp_multi.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lots | Yes | The vested RSU lots still held (after any sell-to-cover), one entry per vest tranche. The tool decides which of these to sell and when. Unvested grants are out of scope. At most 20 lots per call, the same cap the web calculator uses. With more tranches than that, combine the ones sharing a vest date and cost basis. | |
| stateCode | Yes | Two-letter US state code (e.g. CA, NY, TX). Drives state capital-gains treatment (CA taxes gains as ordinary; WA/TX/FL have no tax on most capital gains). | |
| currentPrice | Yes | Current share price, USD. Every sale, on every date, is priced at this value (flat-price assumption). This value must come from the user. | |
| filingStatus | Yes | Federal filing status. Drives LTCG brackets, the NIIT threshold, and state bracket lookups. | |
| horizonYears | Yes | Tax years the plan may span: 1 = sell everything now, 2, or 3. More years let the plan spread gains across brackets and defer short-term lots to long-term, at the cost of staying exposed to the stock longer. The user's choice, not a modelling detail, and it changes the answer: use the value they gave, and if they gave none, ask for it rather than assuming one. | |
| divestFraction | Yes | Fraction of TOTAL shares to divest, as a decimal (0.5 = sell half). Range 0.10 to 1.0. NOTE: a decimal fraction, NOT a percent, so pass 0.5 not 50. The tool sells round(divestFraction x totalShares) shares, floored at 1. The user's choice, not a modelling detail, and it changes the answer: use the value they gave, and if they gave none, ask for it rather than assuming one. | |
| ordinaryIncome | Yes | Total household ordinary income for the year, USD, from all sources. Sets the federal LTCG bracket floor, the short-term ordinary rate, and the net investment income tax (NIIT) threshold test. This is taxable income after deductions, not gross wages: the engine applies no standard or itemized deduction to it. Assumed constant across plan years. Must come from the user. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schedule | Yes | The sell plan, grouped by tax year. | |
| totalTax | Yes | Total plan tax across all years (federal LTCG + NIIT + state, net of in-plan loss carryforward), in dollars. | |
| totalGross | Yes | Gross proceeds from the divested shares, in dollars. | |
| attribution | Yes | Telescoping attribution of the total saving vs a FIFO-all-today sale. lotSelection + spreadingDeferral = total. | |
| totalShares | Yes | Total shares across all input lots. | |
| horizonCards | Yes | The same divest target under a 1-year ("all now"), 2-year, and 3-year plan, for the trade-off strip. | |
| sharesToSell | Yes | Shares the plan divests (round(divestFraction x totalShares), floored at 1). | |
| totalAfterTax | Yes | After-tax proceeds from the divested shares, in dollars. | |
| deferralCallouts | Yes | Per-lot short-term-to-long-term deferral opportunities. | |
| keptUnrealizedGain | Yes | Unrealized gain still carried by the shares NOT sold, in dollars (deferred, not eliminated). | |
| headlineDeltaVsFifo | Yes | Dollars saved versus selling oldest-first (FIFO) on the SAME schedule. Pure lot-selection benefit; >= 0 by construction. | |
| headlineAfterTaxKept | Yes | After-tax proceeds under the plan, in dollars: the headline "you keep $X" figure. | |
| carryforwardRemaining | Yes | Capital loss remaining at the end of the plan horizon, in dollars (reported, not modeled into future years). |