diff --git a/calc.js b/calc.js index c4b6ad1..b887e13 100644 --- a/calc.js +++ b/calc.js @@ -119,12 +119,9 @@ function run_simulation(p) { const selling_costs = home_value * (p.closing_sell_pct / 100); const buyer_nw = home_value - selling_costs - balance + buyer_portfolio; - // apply capital gains tax on portfolio gains when we "cash out" at end - // (we track gross portfolio, deduct tax in summary) - const renter_nw = portfolio; - - // breakeven: when buyer net worth overtakes renter - if (breakeven_month === null && buyer_nw >= renter_nw) { + // breakeven uses after-tax renter value to match what the chart shows + const renter_nw_after_tax = portfolio - Math.max(0, portfolio - start_capital) * (p.tax_rate / 100); + if (breakeven_month === null && buyer_nw >= renter_nw_after_tax) { breakeven_month = m; }