Skip to content

LoanManage

[Source]

Attention

Lending Protocol and Single Asset Vaults are disabled on Devnet. You have two options for testing these features:

  1. Run rippled in stand-alone mode and enable LendingProtocol and SingleAssetVault in the rippled.cfg file.
  2. Connect to the Lending Protocol-specific Devnet at https://lend.devnet.rippletest.net:51234/.

Manages the state of a Loan ledger entry, including defaulting, impairing, or unimpairing a loan.

Only the LoanBroker ledger entry owner can initiate this transaction.

(Requires the Lending Protocol amendment )

Example LoanManage JSON

{
  "TransactionType": "LoanManage",
  "Account": "rEXAMPLE9AbCdEfGhIjKlMnOpQrStUvWxYz",
  "Fee": "12",
  "Flags": 65536,
  "LastLedgerSequence": 7108682,
  "Sequence": 8,
  "LoanID": "E123F4567890ABCDE123F4567890ABCDEF1234567890ABCDEF1234567890ABCD"
}

LoanManage Fields

In addition to the common fields, LoanManage transactions use the following fields:

Field NameJSON TypeInternal TypeRequired?Description
LoanIDStringHash256YesThe ID of the Loan ledger entry to manage.
FlagsStringUInt32NoThe flag to modify the loan.

LoanManage Flags

Transactions of the LoanManage type support additional values in the flags field, as follows:

Field NameHex ValueDecimal ValueDescription
tfLoanDefault0x0001000065536Indicates the loan should be defaulted.
tfLoanImpair0x00020000131072Indicates the the loan should be impaired.
tfLoanUnimpair0x00040000262144Indicates the the loan should be unimpaired.

Error Cases

Besides errors that can occur for all transactions, LoanManage transactions can result in the following transaction result codes:

Error CodeDescription
temINVALIDthe LoanID field is missing or set to zero.
temINVALID_FLAGMultiple management flags have been set. Only one can be set at a time.
tecNO_ENTRYThe loan specified by LoanID doesn't exist.
tecNO_PERMISSION- The transaction is attempting to modify a defaulted loan, or a fully paid loan.
- The transaction is attempting to change the loan's impairment status to the one it already has.
tecTOO_SOONThe loan can't be marked as defaulted before its payment due date and grace period have passed.
tecLIMIT_EXCEEDEDMarking the loan as impaired creates a loss greater than the vault's oustanding assets, which would put the vault in an invalid state.