Recent proposals from the developers of the XRP Ledger aim to enhance the lending protocol, focusing on improving the calculation of loan repayments and addressing issues related to rounding errors.
summary
The developers introduced the proposal on November 6th via GitHub, detailing how these modifications will refine loan balances and repayment schedules. By addressing rounding discrepancies, the adjustments aim to ensure that the final payment aligns precisely with borrower expectations.
The proposed changes are still pending approval and have not yet been activated on the XRP Ledger mainnet. Developers have conducted extensive tests considering multiple accounting methods and varied loan scenarios.
Enhanced Repayment Calculation Mechanism
At the heart of this proposal is a revised repayment calculation method designed to improve how the XRP Ledger reflects remaining balances after each loan payment.
Under the current system, loan installments are calculated as individual amounts. This method has led to the accumulation of small rounding differences which can result in a final payment that exceeds the intended amount.
The new proposal incorporates a mechanism known as “telescoping,” which calculates the outstanding balance based on the total repayment schedule. This approach eliminates the cumulative rounding errors by synchronizing the unpaid amount to the remaining scheduled payment.
With LendingProtocolV1_2, each loan payment will directly reduce the TotalValueOutstanding to the agreed upon scheduled amount and will decrease the remaining installments accordingly. The adjustments ensure that every installment correlates accurately to the rounded periodic payment amount, preventing discrepancies.
Revisions to LoanSet and LoanPay Calculations
The proposed code amendments encompass the LoanSet and LoanPay processes, which are integral to establishing loan conditions and managing payments on the ledger.
The initial commit has been designed to transfer the calculation of the scheduled loan amount from the function computeLoanProperties to a new one called scheduledValue. This adjustment aims to unify the rounding methodology throughout both the creation of loans and the repayment processes.
The subsequent commit focuses on refining repayment mechanisms within the LendingProtocolV1_2, particularly when a borrower makes an approved overpayment. Following such a payment, TotalValueOutstanding will be recalibrated based on the revised periodic payment schedule, ensuring that future repayments align with the updated plan.
Additionally, safeguards will be instituted to protect the principal component of each installment, ensuring that accrued interest is not counted negatively.
For interest-free loans, rounding will occur separately; the total loan will be rounded to the nearest whole unit while the principal will be rounded up.
Addressing Existing Rounding Discrepancies
While these proposed revisions aim to streamline future repayment calculations, they will not automatically rectify rounding differences present in existing loans. The GitHub proposal clarifies that loans currently exhibiting rounding discrepancies will maintain their status until an approved overpayment occurs.
As such, some existing loans may close with a final payment that requires an amount equal to the rounded installment plus one additional unit.
Although minor overpayments may not trigger significant changes if they fall within current rounding thresholds, the developers have included test cases to ensure that the new amendment can apply to outstanding loans while maintaining accurate repayment records.
It’s important to note that these changes focus specifically on the accounting of loans within the proposed lending protocol and do not alter standard XRP transactions or create new borrowing options for XRP holders.
Need for Validator Consensus on LendingProtocolV1_2
This initiative is part of the XRP Ledger’s ongoing evolution concerning native lending, enabling fixed-term loans through dedicated asset vaults.
Previously, updates to the ledger, such as those found in version 3.4.0, introduced features like closed-end vaults and cash-basis accounting under the LendingProtocolV1_1 framework.
The envisaged lending structure will leverage pooled assets for loans, with brokers responsible for assessing borrowers and managing associated credit risk externally.
However, a review of validator voting outcomes in October indicated an insufficient consensus for the recent financing and vault modifications, preventing their activation.
Additionally, a maintenance update on November 4th focused on transaction processing improvements without facilitating the activation of the lending protocol.
For the protocol amendments to take effect, a majority vote of at least 80% from validated participants is necessary for a two-week span. Currently, pull request #8698 remains pending, and no specific date for mainnet activation of LendingProtocolV1_2 has been disclosed.
