From f10845cb77d4e26e37925652b7f5389957d555fb Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 20 Mar 2026 02:53:25 +0100 Subject: [PATCH] fix breakeven to compare against after-tax renter portfolio --- calc.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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; }