fix breakeven to compare against after-tax renter portfolio

This commit is contained in:
Johannes
2026-03-20 02:53:25 +01:00
parent 767a2e4cfc
commit f10845cb77

View File

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