
Ripple’s XRP Ledger developers have proposed a targeted fix to how loan repayments are rounded — a small change with meaningful consequences for borrowers and lenders on the ledger.
What’s changing
- On Nov. 6 a GitHub pull request introduced LendingProtocolV1_2, a protocol amendment that corrects how outstanding loan balances are computed after each repayment. The proposal aims to prevent tiny rounding differences from accumulating across installments and leaving a final payment one unit higher than expected.
- The change is under review (PR #8698) and has not been activated on mainnet.
Why this matters
- Under the current logic, each scheduled installment is calculated separately. Small rounding errors can build up over multiple payments so that the final installment ends up slightly larger than the rounded periodic payment borrowers were told to expect.
- The proposed fix uses a “telescoping” approach: rather than letting each installment’s separate calculation add up inconsistently, the ledger recalculates the remaining schedule after each payment and aligns TotalValueOutstanding with the rest of the remaining payments. In practice this keeps each installment close to the rounded periodic payment and makes the final installment match the rounded periodic payment exactly for loans following the corrected schedule.
Technical highlights
- The proposal changes both LoanSet (loan creation) and LoanPay (repayments):
- First commit: moves scheduled-value logic out of computeLoanProperties into a new scheduledValue function so loan creation and repayment calculations use consistent rounding. This initial refactor does not alter behavior.
- Second commit: implements the telescoping repayment correction under LendingProtocolV1_2. When borrowers make accepted overpayments, TotalValueOutstanding is reset to a scheduled value based on the revised PeriodicPayment so subsequent installments follow the adjusted plan.
- Safeguards are included so the principal portion of installments can’t be driven negative. Zero-interest loans get special handling because total value and principal rounding behave differently.
- The code caps adjustments at the rounded PeriodicPayment and ensures each scheduled installment’s value is at least one unit.
Testing and limits
- Developers tested the changes across multiple vault accounting models — Legacy, CashBasis and FixedPrecision — and with the amendment both enabled and disabled. Tests also cover activating the amendment while loans remain outstanding, and situations where borrowers pay more than scheduled.
- The fix corrects repayment calculations going forward but does not automatically remove every rounding difference from existing loans. Loans that already carry an extra unit above the scheduled balance will retain that until the borrower overpays; in some cases, a final installment may still equal the rounded PeriodicPayment plus one unit.
- Small overpayments that fall within existing rounding limits can be ignored: the transaction may return success without creating an extra loan payment.
Context within XRP Ledger lending
- These changes are part of the XRP Ledger’s ongoing work to add native lending (fixed‑term loans funded through Single Asset Vaults). Earlier updates in version 3.4.0 (September) introduced closed-ended vaults and cash-basis accounting under LendingProtocolV1_1.
- The proposed lending framework envisions pooled assets funding loans, with brokers handling borrower assessment and credit risk off‑chain.
- An October review showed lending and vault amendments had not yet reached the threshold of validator support required for activation. A separate maintenance amendment did activate on Nov. 4, but it addressed transaction-processing issues and did not enable the lending protocol.
- Under the ledger’s amendment process, any change needs support from more than 80% of trusted validators for two consecutive weeks to activate. No mainnet activation date has been announced for LendingProtocolV1_2.
Bottom line
This proposal cleans up an annoying edge-case in loan accounting that could affect final payments for borrowers. It’s a careful, well-tested adjustment that improves arithmetic consistency in the ledger’s lending logic — but it still needs validator approval and won’t retroactively wipe out every existing rounding discrepancy.
What’s changing
- On Nov. 6 a GitHub pull request introduced LendingProtocolV1_2, a protocol amendment that corrects how outstanding loan balances are computed after each repayment. The proposal aims to prevent tiny rounding differences from accumulating across installments and leaving a final payment one unit higher than expected.
- The change is under review (PR #8698) and has not been activated on mainnet.
Why this matters
- Under the current logic, each scheduled installment is calculated separately. Small rounding errors can build up over multiple payments so that the final installment ends up slightly larger than the rounded periodic payment borrowers were told to expect.
- The proposed fix uses a “telescoping” approach: rather than letting each installment’s separate calculation add up inconsistently, the ledger recalculates the remaining schedule after each payment and aligns TotalValueOutstanding with the rest of the remaining payments. In practice this keeps each installment close to the rounded periodic payment and makes the final installment match the rounded periodic payment exactly for loans following the corrected schedule.
Technical highlights
- The proposal changes both LoanSet (loan creation) and LoanPay (repayments):
- First commit: moves scheduled-value logic out of computeLoanProperties into a new scheduledValue function so loan creation and repayment calculations use consistent rounding. This initial refactor does not alter behavior.
- Second commit: implements the telescoping repayment correction under LendingProtocolV1_2. When borrowers make accepted overpayments, TotalValueOutstanding is reset to a scheduled value based on the revised PeriodicPayment so subsequent installments follow the adjusted plan.
- Safeguards are included so the principal portion of installments can’t be driven negative. Zero-interest loans get special handling because total value and principal rounding behave differently.
- The code caps adjustments at the rounded PeriodicPayment and ensures each scheduled installment’s value is at least one unit.
Testing and limits
- Developers tested the changes across multiple vault accounting models — Legacy, CashBasis and FixedPrecision — and with the amendment both enabled and disabled. Tests also cover activating the amendment while loans remain outstanding, and situations where borrowers pay more than scheduled.
- The fix corrects repayment calculations going forward but does not automatically remove every rounding difference from existing loans. Loans that already carry an extra unit above the scheduled balance will retain that until the borrower overpays; in some cases, a final installment may still equal the rounded PeriodicPayment plus one unit.
- Small overpayments that fall within existing rounding limits can be ignored: the transaction may return success without creating an extra loan payment.
Context within XRP Ledger lending
- These changes are part of the XRP Ledger’s ongoing work to add native lending (fixed‑term loans funded through Single Asset Vaults). Earlier updates in version 3.4.0 (September) introduced closed-ended vaults and cash-basis accounting under LendingProtocolV1_1.
- The proposed lending framework envisions pooled assets funding loans, with brokers handling borrower assessment and credit risk off‑chain.
- An October review showed lending and vault amendments had not yet reached the threshold of validator support required for activation. A separate maintenance amendment did activate on Nov. 4, but it addressed transaction-processing issues and did not enable the lending protocol.
- Under the ledger’s amendment process, any change needs support from more than 80% of trusted validators for two consecutive weeks to activate. No mainnet activation date has been announced for LendingProtocolV1_2.
Bottom line
This proposal cleans up an annoying edge-case in loan accounting that could affect final payments for borrowers. It’s a careful, well-tested adjustment that improves arithmetic consistency in the ledger’s lending logic — but it still needs validator approval and won’t retroactively wipe out every existing rounding discrepancy.




