DEV Community

Michael Lip
Michael Lip

Posted on • Originally published at zovo.one

Simulating Loan Scenarios Before You Sign Anything

Before signing any loan agreement, I run at least five scenarios through a simulator. What happens if rates adjust? What if I lose my job for three months and defer payments? What if I refinance in year three? The monthly payment on the term sheet tells you one story. Simulation tells you all the others.

Why a calculator is not enough

A standard loan calculator answers one question: given a principal, rate, and term, what is the monthly payment? A simulator lets you model changes over time.

Real loans are not static. Variable rates adjust. Borrowers make extra payments some months and skip others. Refinancing opportunities appear mid-term. Life happens. A simulator lets you model these realities before they become surprises.

Variable rate simulation

An adjustable-rate mortgage (ARM) starts with a fixed rate for 3, 5, 7, or 10 years, then adjusts periodically based on an index plus a margin. A 5/1 ARM adjusts annually after the first five years.

function simulateARM(principal, initialRate, fixedYears, 
                      margin, rateAdjustments, totalYears) {
  const n = totalYears * 12;
  let balance = principal;
  let currentRate = initialRate;
  const schedule = [];

  for (let month = 1; month <= n && balance > 0; month++) {
    const year = Math.ceil(month / 12);

    // Rate adjustment after fixed period
    if (year > fixedYears && month % 12 === 1) {
      const adjustmentYear = year - fixedYears - 1;
      if (adjustmentYear < rateAdjustments.length) {
        currentRate = rateAdjustments[adjustmentYear] + margin;
      }
    }

    const r = currentRate / 100 / 12;
    const remainingMonths = n - month + 1;
    const payment = balance * (r * Math.pow(1+r, remainingMonths)) 
                    / (Math.pow(1+r, remainingMonths) - 1);

    const interest = balance * r;
    const principalPaid = payment - interest;
    balance -= principalPaid;

    schedule.push({ month, rate: currentRate, payment, interest, 
                    principalPaid, balance: Math.max(0, balance) });
  }

  return schedule;
}
Enter fullscreen mode Exit fullscreen mode

The critical insight: when the rate adjusts, the payment is recalculated based on the remaining balance and remaining term. A 2% rate increase in year 6 can increase the monthly payment by $300 or more on a $300,000 mortgage. Running this simulation shows you the worst case before you sign.

Payment shock analysis

Payment shock is the percentage increase in monthly payment when a rate adjusts. Lenders use this metric to evaluate borrower risk, and you should use it to evaluate your own risk tolerance.

Payment shock = (new payment - old payment) / old payment * 100
Enter fullscreen mode Exit fullscreen mode

Most financial advisors recommend that your mortgage payment not exceed 28% of gross income. If a rate adjustment could push your payment above that threshold, the ARM is too risky for your income level.

A good simulation runs the worst-case scenario: what if the rate hits the lifetime cap? On a 5/1 ARM with a 2/2/5 cap structure (2% first adjustment, 2% per subsequent adjustment, 5% lifetime cap), starting at 4%, the worst case is 9%. Know what 9% means for your monthly payment before you accept 4%.

Deferred payment modeling

What happens if you need to pause payments? Some loans offer forbearance or deferment, but the mechanics vary:

  • Interest pause (rare). Both principal and interest are frozen. This is the best case and almost never offered.
  • Interest accrual. Payments stop but interest continues. The balance grows during deferment.
  • Capitalization. Accrued interest is added to the principal when payments resume. Now you pay interest on the interest.
function simulateDeferment(balance, annualRate, deferMonths) {
  const r = annualRate / 100 / 12;
  let newBalance = balance;

  for (let i = 0; i < deferMonths; i++) {
    newBalance += newBalance * r;
  }

  return {
    originalBalance: balance,
    newBalance: newBalance,
    addedCost: newBalance - balance
  };
}

// $200,000 at 6% deferred for 6 months
simulateDeferment(200000, 6, 6);
// { originalBalance: 200000, newBalance: 206076, addedCost: 6076 }
Enter fullscreen mode Exit fullscreen mode

Six months of deferment on a $200,000 loan at 6% adds over $6,000 to the balance. That $6,000 then accrues interest for the remaining life of the loan, compounding the cost further.

Refinancing breakeven

The other critical simulation is refinancing. A lower rate sounds good, but refinancing has costs: origination fees (0.5% to 1.5%), appraisal ($500), title insurance ($1,000+), and other closing costs. The breakeven period is how long it takes for the monthly savings to recoup those costs.

Breakeven months = Total refinancing costs / Monthly savings
Enter fullscreen mode Exit fullscreen mode

If refinancing saves $150/month but costs $6,000 in fees, the breakeven is 40 months. If you plan to sell the home in 3 years, refinancing loses money. If you plan to stay 10 years, it saves $12,000 net.

Running comprehensive simulations

For modeling these multi-variable scenarios, I keep a loan simulator at zovo.one/free-tools/loan-simulator. It lets you adjust rates mid-term, add extra payments on specific months, simulate deferment periods, and compare refinancing breakeven. Seeing the full timeline, not just the starting payment, is how you make informed borrowing decisions.


I'm Michael Lip. I build free developer tools at zovo.one. 500+ tools, all private, all free.

Top comments (0)