FA-58657 / Loan amortization schedules / Member archive
Payoff quote with per diem: penalty window · case 02
Payoffs on the last day of the penalty window escape the prepayment penalty.
Case contract
x = {'balance', 'rate_bp', 'last_paid_day', 'payoff_day', 'basis', 'fees_due', 'escrow' (credit, may be negative), 'penalty_bp', 'penalty_until'}. Per diem = round_half_up(balance*bp/(10000*basis)); interest = per diem * (payoff_day - last_paid_day). Penalty = round_half_up(balance*penalty_bp/10000) when payoff_day <= penalty_until, else 0. Payoff = balance + interest + fees + penalty - escrow. Return {'per_diem', 'interest', 'penalty', 'payoff'}.
Why this case matters
Amortization engines drive borrower statements, payoff quotes and investor remittances; a misplaced rounding step, boundary or ordering rule compounds across hundreds of periods.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: penalty window | {"interest": 61740, "payoff": 12414918, "penalty": 0, "per_diem": 2058} | {"interest": 61740, "payoff": 12661832, "penalty": 246914, "per_diem": 2058} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗