Skip to content

LoanBroker

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

A LoanBroker ledger entry defines the configuration and state of a lending protocol instance. It tracks details such as fees and first-loss capital cover. You can create a LoanBroker object with the LoanBrokerSet transaction.

The LoanBroker entry is tracked in an Owner Directory owned by the account that submitted the LoanBrokerSet transaction. To facilitate lookup, it is also tracked in the OwnerDirectory of the associated vault's pseudo-account.

Note

The lending protocol uses the pseudo-account of the associated Vault entry to hold the first-loss capital.

(Requires the Lending Protocol amendment )

Example LoanBroker JSON

{
  "LedgerEntryType": "LoanBroker",
  "LedgerIndex": "E123F4567890ABCDE123F4567890ABCDEF1234567890ABCDEF1234567890ABCD",
  "Flags": "0",
  "PreviousTxnID": "9A8765B4321CDE987654321CDE987654321CDE987654321CDE987654321CDE98",
  "PreviousTxnLgrSeq": 12345678,
  "Sequence": 1,
  "LoanSequence": 2,
  "OwnerNode": 2,
  "VaultNode": 1,
  "VaultID": "ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890",
  "Account": "rBROKER9AbCdEfGhIjKlMnOpQrStUvWxYz",
  "Owner": "rEXAMPLE9AbCdEfGhIjKlMnOpQrStUvWxYz",
  "Data": "5468697320697320617262697472617279206D657461646174612061626F757420746865206C6F616E62726F6B65722E",
  "ManagementFeeRate": 100,
  "OwnerCount": 3,
  "DebtTotal": 50000,
  "DebtMaximum": 100000,
  "CoverAvailable": 10000,
  "CoverRateMinimum": 1000,
  "CoverRateLiquidation": 500
}

LoanBroker Fields

In addition to the common ledger entry fields, LoanBroker entries have the following fields:

NameJSON TypeInternal TypeRequired?Description
PreviousTxnIDStringHash256YesIdentifies the transaction ID that most recently modified this object.
PreviousTxnLgrSeqNumberUInt32YesThe sequence of the ledger that contains the transaction that most recently modified this object.
SequenceNumberUInt32YesThe transaction sequence number that created the LoanBroker.
LoanSequenceNumberUInt32YesA sequential identifier for Loan ledger entires, incremented each time a new loan is created by this LoanBroker.
OwnerNodeNumberUInt64YesIdentifies the page where this item is referenced in the owner's directory.
VaultNodeNumberUInt64YesIdentifies the page where this item is referenced in the Vault pseudo-account owner's directory.
VaultIDStringHash256YesThe ID of the vault that provides the loaned assets.
AccountStringAccountIDYesThe address of the LoanBroker pseudo-account.
OwnerStringAccountIDYesThe account address of the vault owner.
DataStringBlobNoArbitrary metadata about the vault. Limited to 256 bytes.
ManagementFeeRateNumberUInt16NoThe fee charged by the lending protocol, in units of 1/10th basis points. Valid values are 0 to 100000 (inclusive), representing 0% to 100%.
OwnerCountNumberUInt32YesThe number of active loans issued by the LoanBroker.
DebtTotalNumberNumberYesThe total asset amount the protocol owes the vault, including interest.
DebtMaximumNumberNumberYesThe maximum amount the protocol can owe the vault. The default value of 0 means there is no limit to the debt.
CoverAvailableNumberNumberYesThe total amount of first-loss capital deposited into the lending protocol.
CoverRateMinimumNumberUInt32YesThe 1/10th basis point of the DebtTotal that the first-loss capital must cover. Valid values are 0 to 100000 (inclusive), representing 0% to 100%.
CoverRateLiquidationNumberUInt12YesThe 1/10th basis point of minimum required first-loss capital that is moved to an asset vault to cover a loan default. Valid values are 0 to 100000 (inclusive), representing 0% to 100%.

LoanBroker Flags

There are no flags defined for LoanBroker ledger entries.

LoanBroker Reserve

Loan entries incur one owner reserve from the account that creates it.

LoanBroker ID Format

The ID of a LoanBroker entry is the [SHA512-Half][] of the following values, concatenated in order:

  • The LoanBroker space key 0x006C.
  • The AccountID of the account submitting the LoanBrokerSet transaction.
  • The transaction Sequence number. If the transaction used a [Ticket][], the TicketSequence value is used instead.