FA-58654 / Loan amortization schedules / Member archive
Payoff quote with per diem: interest day count · case 04
Payoff quotes charge one extra day of interest.
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: interest day count | {"interest": 31, "payoff": 8631, "penalty": 100, "per_diem": 1} | {"interest": 30, "payoff": 8630, "penalty": 100, "per_diem": 1} | 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 ↗