Yield maintenance and defeasance calculator

Yield maintenance and defeasance calculator: prepayment premium and total payoff for a fixed-rate loan, plus step-down and flat-percentage penalties.

What it computes

The calculator finds the prepayment premium and total payoff for a fixed-rate commercial loan repaid before maturity. It supports four provisions: yield maintenance, a step-down schedule (such as 5-4-3-2-1), a flat percentage, and defeasance. Yield maintenance compensates the lender for the gap between the note rate and current Treasury yields over the remaining term. Defeasance replaces the loan's collateral with government securities that fund the remaining payments; its cost is the price of those securities plus transaction costs, less the balance.

Method and conventions

The calculator first rebuilds the remaining payment stream. The monthly note rate is i = note_rate_annual ÷ 12. The level payment is balance × i ÷ (1 − (1 + i)^−amortization_months), or balance × i when amortization_months is 0 (interest-only). The balance rolls forward month by month. The balloon is the scheduled balance after remaining_term_months payments, and it is added to the final payment. Payment 1 falls one month after the payoff date.

Yield maintenance. The discount rate is treasury_rate_annual + spread_annual, converted to a monthly rate m. There are two bases:

  • pv_of_payments (default): premium = Σ payment_k ÷ (1 + m)^k − balance, for k = 1 … remaining_term_months, balloon included.
  • rate_differential: premium = Σ (note rate − discount rate) ÷ 12 × scheduled opening balance_k ÷ (1 + m)^k.

The premium is the larger of the computed amount and balance × minimum_pct, which defaults to a 1% floor.

Loan documents differ in three places, and each is an input. The first is the basis (basis). The second is Treasury flat or Treasury plus a spread (spread_annual). The third is the compounding convention (discount_convention). The monthly convention uses m = annual ÷ 12. The semiannual convention treats the yield as a bond-equivalent yield and uses m = (1 + annual ÷ 2)^(1/6) − 1. Notes also differ on which Treasury is the reference. FactLot does not look one up or interpolate; the yield is supplied. Discounting always runs to maturity, not to the start of an open prepayment window.

Step-down and flat percentage. A step-down premium is balance × pct for the first tier whose through_month is at or after loan_month. After the last tier the loan is open and the premium is 0. A flat percentage is balance × pct.

Defeasance. Each remaining payment is discounted at the replacement yield for its month. That yield is either one flat rate or a step curve of {months, rate} points, where each payment uses the first point whose months is at or after its month and payments beyond the last point use the last rate. The premium is securities cost + costs − balance. It has no floor and can be negative when replacement yields exceed the note rate.

For every type, total payoff is balance + premium + accrued_interest, and the effective cost ratio is premium ÷ balance.

Inputs that matter

  • balance: outstanding principal at the payoff date.
  • note_rate_annual: the fixed note rate as a decimal.
  • remaining_term_months: months from payoff to maturity, when the balloon is due.
  • amortization_months: remaining amortization at payoff (for example 300 on a 30-year schedule five years in), or 0 for interest-only.
  • accrued_interest: unpaid interest to the payoff date, added to the payoff.
  • prepayment.type: yield_maintenance, step_down, fixed_pct or defeasance.
  • prepayment.treasury_rate_annual and prepayment.spread_annual: the yield-maintenance discount rate.
  • prepayment.basis, prepayment.discount_convention and prepayment.minimum_pct: how yield maintenance is computed and floored.
  • prepayment.replacement_yield and prepayment.costs: the defeasance yield or curve, and stated consultant, legal, rating agency and servicer fees.

Limits

  • Fixed-rate loans with monthly payments only. Interest is on a 30/360 basis; actual/360 accrual is not modeled.
  • The payoff is assumed to fall on a payment date. Stub-period interest enters only through accrued_interest.
  • Lockout periods are not modeled. A step-down result carries a warning that a locked-out loan cannot be prepaid at any premium.
  • The defeasance cost is an approximation. It discounts each payment at a stated yield rather than pricing specific Treasury or agency securities, and it ignores residual or float value. The result carries a warning to that effect.
  • The calculator does not decide whether a borrower keeps a negative defeasance premium; that depends on the loan documents.
  • loan_month for a step-down is not checked against the remaining term. Taxes, exit fees and partial prepayments are not modeled.

Worked example

Inputs from FactLot's shared test case "yield maintenance on an interest-only loan, PV of payments at Treasury flat", which the TypeScript and Python libraries must both reproduce:

{
  "balance": 10000000,
  "note_rate_annual": 0.06,
  "remaining_term_months": 36,
  "amortization_months": 0,
  "prepayment": {
    "type": "yield_maintenance",
    "treasury_rate_annual": 0.04
  }
}

Result

Result values
ResultValue
prepayment_typeyield_maintenance
monthly_payment50,000
balloon_at_maturity10,000,000
total_remaining_payments11,800,000
prepayment_premium564,512.77
total_payoff10,564,512.77
effective_cost_ratio0.056451

Audit trail

Every intermediate value, in order, with the formula that produced it. Formula calc.prepayment_and_defeasance@1.

Audit trail
StepValueFormula
Monthly payment$50,000.00interest-only: $10,000,000.00 × 6% ÷ 12
Balloon at maturity$10,000,000.00scheduled balance after 36 payments
Remaining scheduled payments$11,800,000.0036 × $50,000.00 + balloon
Discount rate0.003333(4% Treasury + 0% spread) → monthly, monthly convention
PV of remaining payments$10,564,512.77Σ payment_k ÷ (1 + 0.00333333)^k, k = 1..36
Yield maintenance (before floor)$564,512.77$10,564,512.77 − $10,000,000.00 balance
Minimum premium$100,000.00$10,000,000.00 × 1%
Prepayment premium$564,512.77max(yield maintenance, minimum)
Total payoff$10,564,512.77$10,000,000.00 balance + $564,512.77 premium + $0.00 accrued interest
Effective cost0.056451$564,512.77 ÷ $10,000,000.00 = 5.645% of balance

Warnings

  • Yield maintenance computed on the pv_of_payments basis, discounting monthly at Treasury flat; notes differ on all three, so match them to the loan documents.

Use it from an agent or your code

  • MCP: tool calc_prepayment_and_defeasance on https://api.factlot.com/mcp (connect a client).
  • Python: factlot.run_tool("calc_prepayment_and_defeasance", input) runs the same calculation offline (Python SDK).
  • Input schema: every field is described in tools.json.
curl -s https://api.factlot.com/v1/calc/prepayment_and_defeasance \
  -H 'content-type: application/json' \
  -d '{"balance":10000000,"note_rate_annual":0.06,"remaining_term_months":36,"amortization_months":0,"prepayment":{"type":"yield_maintenance","treasury_rate_annual":0.04}}'