Skip to content

LoanBrokerCoverWithdraw

[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/.

Withdraws first-loss capital from a LoanBroker ledger entry.

Only the owner of the associated LoanBroker entry can initiate this transaction.

(Requires the Lending Protocol amendment )

Example LoanBrokerCoverWithdraw JSON

{
  "TransactionType": "LoanBrokerCoverWithdraw",
  "Account": "rEXAMPLE9AbCdEfGhIjKlMnOpQrStUvWxYz",
  "Fee": "12",
  "Flags": 0,
  "LastLedgerSequence": 7108682,
  "Sequence": 8,
  "LoanBrokerID": "E123F4567890ABCDE123F4567890ABCDEF1234567890ABCDEF1234567890ABCD",
  "Amount": {
    "currency": "USD",
    "issuer": "rIssuer1234567890abcdef1234567890abcdef",
    "value": "1000"
  }
}

LoanBrokerCoverWithdraw Fields

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

Field NameJSON TypeInternal TypeRequired?Description
LoanBrokerIDStringHash256YesThe ID of the LoanBroker ledger entry to withdraw from.
AmountObjectAmountYesThe amount of first-loss capital to withdraw.
DestinationStringAccountIDNoAn account to receive the assets.

Error Cases

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

Error CodeDescription
temINVALIDThe LoanBrokerID field is invalid.
temBAD_AMOUNTThe amount to withdraw is lass than or equal to 0.
temMALFORMEDThe Destination account is empty or 0. You can also receive this error if the destination tag is set, but Destination isn't.
tecNO_ENTRYThe specified LoanBroker ledger entry doesn't exist.
tecWRONG_ASSETThe withdrawal asset doesn't match the asset in the vault.
tecNO_DSTThe Destination provided doesn't exist on the ledger.
tecDST_TAG_NEEDEDThe Destination account requires a destination tag.
tecINSUFFICIENT_FUNDSThere isn't enough first-loss capital to withdraw. You can also receive this error if the issuer of the asset has frozen the account or placed a global freeze.
tecNO_PERMISSIONThe account sending the transaction isn't the owner of the LoanBroker ledger entry.
tecPATH_DRYThe XRP Ledger failed to send the funds to the Destination.