From cf121945a8d5dcd52dffb5f07a1ea1c0af47bc14 Mon Sep 17 00:00:00 2001 From: Vito <5780819+Tapanito@users.noreply.github.com> Date: Wed, 11 Mar 2026 10:45:47 +0100 Subject: [PATCH] xls-66: fix equation (23) to include managementFee_overpayment in principal reduction --- XLS-0066-lending-protocol/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/XLS-0066-lending-protocol/README.md b/XLS-0066-lending-protocol/README.md index 4b5a14b36..4df38ff6e 100644 --- a/XLS-0066-lending-protocol/README.md +++ b/XLS-0066-lending-protocol/README.md @@ -1764,17 +1764,16 @@ $$ #### 5.2 Principal Reduction $$ -principalPortion = overpaymentAmount - overpaymentInterest_{net} - overpaymentFee \quad \text{(23)} +principalPortion = overpaymentAmount - overpaymentInterest_{net} - managementFee_{overpayment} - overpaymentFee \quad \text{(23)} $$ **Where:** - `overpaymentAmount` = The excess funds after all periodic payments are settled (formula 19) -- $overpaymentInterest_{net}$ = Gross overpayment interest minus management fee (formula 21) +- $overpaymentInterest_{net}$ = Net overpayment interest owed to the Vault (formula 21) +- $managementFee_{overpayment}$ = Management fee on the overpayment interest (formula 14) - `overpaymentFee` = Percentage-based fee on the overpayment amount (formula 22) -**Note:** The management fee has already been deducted from $overpaymentInterest_{net}$, so it does not appear as a separate term in this formula. - #### 5.3 Re-amortization Value Change The pseudo-code in [Appendix A-3.3](#a-33-pseudo-code) handles re-amortization by preserving historical rounding errors while applying the overpayment to reduce the principal. The process follows these logical steps: