Lending Protocol and Single Asset Vaults are disabled on Devnet. You have two options for testing these features:
- Run
rippledin stand-alone mode and enableLendingProtocolandSingleAssetVaultin the rippled.cfg file. - Connect to the Lending Protocol-specific Devnet at
https://lend.devnet.rippletest.net:51234/.
Makes a payment on an active loan. Only the borrower on the loan can make payments, and payments must meet the minimum amount required for that period.
(Requires the Lending Protocol amendment )
A loan payment has four types, depending on the amount and timing of the payment:
- Regular Payment: A payment made on time, where the payment size and schedule are calculated with a standard amortization formula.
- Late Payment: A payment made after the
NextPaymentDueDatein theLoanledger entry. Late payments include aLatePaymentFeeandLateInterestRate. - Early Full Payment: A payment that covers the outstanding principal of the loan. A
CloseInterestRateis charged on the outstanding principal. - Overpayment: A payment that exceeds the required minimum payment amount.
To see how loan payment transactions are calculated, see transaction pseudo-code.
{
"TransactionType": "LoanPay",
"Account": "rBORROWER9AbCdEfGhIjKlMnOpQrStUvWxYz",
"Fee": "12",
"Flags": 0,
"LoanID": "ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890",
"Amount": 1000,
"Sequence": 10,
"LastLedgerSequence": 7108701
}In addition to the common fields, LoanPay transactions use the following fields:
| Field Name | JSON Type | Internal Type | Required? | Description |
|---|---|---|---|---|
LoanID | String | Hash256 | Yes | The ID of the Loan ledger entry to repay. |
Amount | Number | Amount | Yes | The amount to pay toward the loan. |
Transactions of the LoanPay type support additional values in the flags field, as follows:
| Flag Name | Hex Value | Decimal Value | Description |
|---|---|---|---|
tfLoanOverpayment | 0x00010000 | 65536 | Indicates that the remaining payment amount should be treated as an overpayment. |
tfLoanFullPayment | 0x00020000 | 131072 | Indicates that the borrower is making a full early repayment. |
Besides errors that can occur for all transactions, LoanPay transactions can result in the following transaction result codes:
| Error Code | Description |
|---|---|
temINVALID | The LoanID field is missing or set to zero. |
temBAD_AMOUNT | The Amount field must specify a positive value. |
tecNO_ENTRY | The loan specified by LoanID doesn't exist. |
tecNO_PERMISSION | The account submitting the transaction isn't the borrower on the loan. |
tecTOO_SOON | The loan hasn't started yet. |
tecKILLED | The loan is already fully paid. |
tecWRONG_ASSET | The asset specified by Amount doesn't match the asset of the loan. |
tecFROZEN | The borrower's account is frozen for the specified asset, or the loan broker's pseudo-account is deep-frozen and can't receive funds. |