Cash-Basis Loans
Recognizes Loan interest in the Vault when it is paid, and tracks principal only in LoanBroker.DebtTotal
- Author
- Vytautas Vito Tumas
- Created
- 2026-11-25
- Updated
- 2026-11-25
- Requires
- XLS-65.4.3
- Discussion
- XRPLF/XRPL-Standards/discussions/190
- Amendment
LendingProtocolV1_1- Patch of
- XLS-0066: Lending Protocol
66.4.1 Cash-Basis Loans¶
1. Abstract¶
Under LendingProtocolV1_1, Loans issued from a cash-basis Vault use cash-basis accounting. A new Loan does not add its interest to Vault.AssetsTotal. Interest is added to Vault.AssetsTotal when the Borrower pays it. LoanBroker.DebtTotal tracks the principal of the broker's Loans and no interest. Impairment and default use the Loan's outstanding principal as the Vault's exposure.
2. Motivation¶
The parent protocol recognizes all scheduled interest in Vault.AssetsTotal when a Loan is created. Depositors who redeem shares before the interest is paid receive a share of interest the Vault has not received, and a default must reverse interest that was never collected. Cash-basis accounting records only value the Vault holds or has lent out.
3. Specification¶
This patch changes the parent XLS-66 sections named below. All other parent behavior is unchanged.
3.1 Scope¶
The rules in this patch apply to a Loan whose LoanBroker is attached to a Vault with LEVersion 1 or later. VaultCreate sets LEVersion when the Vault is created, from the amendments enabled at that time; see XLS-65.4.3. A Vault created before LendingProtocolV1_1 was enabled has no LEVersion. It and its brokers and Loans keep the parent rules for their whole life, even after the amendment is enabled.
3.2 Ledger Entry: LoanBroker¶
3.2.1 Fields¶
DebtTotal is the sum of PrincipalOutstanding over the broker's Loans, adjusted for rounding. It does not include interest.
3.3 Transaction: LoanSet¶
3.3.1 Failure Conditions¶
In parent §3.8.5.2:
- Checks 6 and 14 (
Vault.AssetsMaximum) do not apply. - In checks 19 and 20, the new debt total is
LoanBroker.DebtTotal + PrincipalRequested.
3.3.2 State Changes¶
Parent §3.8.6 steps 6 and 7 become:
- Update
Vaultobject:- Decrease
Vault.AssetsAvailablebyPrincipalRequested. Vault.AssetsTotalis unchanged.
- Decrease
- Update
LoanBrokerobject:- Increase
LoanBroker.DebtTotalbyPrincipalRequested. - Increment
LoanBroker.OwnerCountby1. - Increment
LoanBroker.LoanSequenceby1.
- Increase
3.4 Transaction: LoanPay¶
3.4.1 State Changes¶
Parent §3.11.5 steps 6 and 7 become:
LoanBrokerUpdates:LoanBroker.DebtTotalis decreased byprincipalPaid.- If fees were directed to the cover pool,
LoanBroker.CoverAvailableincreases bytotalToBroker.
VaultUpdates:Vault.AssetsAvailableincreases bytotalToVault.Vault.AssetsTotalincreases byinterestPaid.
interestPaid includes the interest of each periodic payment, late interest, close interest and overpayment interest paid by this transaction.
3.5 Transaction: LoanManage¶
3.5.1 Failure Conditions¶
In parent §3.10.4.2 check 8, the loss added by tfLoanImpair is Loan.PrincipalOutstanding: the check is Vault.LossUnrealized + Loan.PrincipalOutstanding > Vault.AssetsTotal - Vault.AssetsAvailable. (tecLIMIT_EXCEEDED) For a Vault with LEVersion 2, XLS-66.7.1 replaces this check.
3.5.2 State Changes¶
In parent §3.10.5:
tfLoanDefault:DefaultAmount = Loan.PrincipalOutstanding. All other steps use thisDefaultAmountunchanged:Vault.AssetsTotaldecreases byDefaultAmount - DefaultCovered,LoanBroker.DebtTotaldecreases byDefaultAmount, and, if the Loan is impaired,Vault.LossUnrealizeddecreases byDefaultAmount.tfLoanImpair:LossUnrealized = Loan.PrincipalOutstanding.tfLoanUnimpair:LossReversed = Loan.PrincipalOutstanding.
The same values apply when LoanPay unimpairs a Loan before a payment.
4. Rationale¶
The Vault's share price is computed from Vault.AssetsTotal. Recognizing interest only when it is paid keeps the share price tied to assets the Vault holds or has lent. Interest that is never paid is never recognized, so a default writes down only the unpaid principal.
Vault.AssetsMaximum limits deposits. Under cash-basis accounting a new Loan moves value from AssetsAvailable to the Loan without changing AssetsTotal, so the parent checks that stop a Loan from pushing AssetsTotal past AssetsMaximum no longer apply.
Selecting the rules by LEVersion keeps the accounting of every existing Vault consistent for its whole life.
5. Backwards Compatibility¶
Vaults created before LendingProtocolV1_1 was enabled, and their brokers and Loans, are unchanged. Clients that read LoanBroker.DebtTotal or Vault.AssetsTotal must check the Vault's LEVersion to know whether interest is included.
6. Security Considerations¶
A cash-basis Vault never holds interest it has not received, so the paper value written down on default is limited to principal. Implementations must select the accounting rules from the Vault's LEVersion, not from the amendments enabled when a later transaction runs; mixing the two would apply different rules to the same Loan over its life.