Deposit and Withdraw First-Loss Capital
This tutorial shows how a loan broker deposits and withdraws first-loss capital for a LoanBroker entry on the XRP Ledger. First-loss capital helps protect the assets of vault depositors, acting as a buffer if loans default.
- Section
- Tutorials
What you will do
You deposit an MPT as first-loss capital into a LoanBroker entry. You check the available cover balance in the loan broker's pseudo-account. Then you withdraw first-loss capital from the LoanBroker entry.
What you need
You need a basic understanding of the XRP Ledger and a client library. The examples use JavaScript with xrpl.js, Python with xrpl-py and Go with xrpl-go. The tutorial requires the LendingProtocol amendment, which the source lists as open for voting, and the LendingProtocolV1_1 amendment updates it. The JavaScript code expects both amendments, the Python and Go code only LendingProtocol.
Making the deposit
After installing what the code depends on and connecting a client, you load the loan broker account, the loan broker ID and the MPT issuance ID. You create a LoanBrokerCoverDeposit transaction, where the Amount field states the MPT and the amount to deposit. You sign and submit it and check for a tesSUCCESS result code. If it succeeds, the amount is held in the pseudo-account associated with the LoanBroker entry.
Checking the cover balance
You read the cover balance from the transaction result, in the LoanBroker entry of the transaction metadata. The Account field there is the address of the LoanBroker pseudo-account. The CoverAvailable field shows the cover balance.
Making the withdrawal
You create a LoanBrokerCoverWithdraw transaction, sign it and submit it. Again you check for a tesSUCCESS result code. The CoverAvailable field in the result now shows the reduced balance after the withdrawal.
Source: xrpl.org. Read 6 December 2026.
Zerpedia states what the source says, in plain words, and gives no opinion. How Zerpedia is made