Loan prepayment premium and defeasance
calc_prepayment_and_defeasancePrepayment premium, total payoff, and cost as a share of balance for a fixed-rate amortizing or interest-only loan under yield maintenance (PV of remaining payments or rate differential, with a minimum and an explicit discounting convention), a step-down schedule, a flat percentage, or defeasance (cost of the securities portfolio that funds the remaining payments plus stated costs). Deterministic: use this instead of doing the math yourself; cite formula calc.prepayment_and_defeasance@1 and the returned steps, and surface any warnings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| balance | Yes | Outstanding principal balance at the payoff date, USD. | |
| prepayment | Yes | Prepayment provision from the note. | |
| accrued_interest | No | Accrued but unpaid interest to the payoff date, USD; added to the total payoff. | |
| note_rate_annual | Yes | Fixed annual note rate, e.g. 0.055. | |
| amortization_months | Yes | Remaining amortization basis in months at the payoff date (e.g. 300 for a 30-year schedule with 5 years elapsed); 0 for interest-only. Must be at least remaining_term_months. | |
| remaining_term_months | Yes | Months from the payoff date to the loan's maturity date (the balloon is due with the final payment). |