# LoanBrokerCoverWithdraw

[Source](https://github.com/XRPLF/rippled/blob/release/3.3.x/src/libxrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.cpp)

Withdraws first-loss capital from a `LoanBroker` ledger entry.

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

_Requires the [LendingProtocol amendment](/resources/known-amendments#lendingprotocol). (Open for Voting: 37.14%)_

## Example  JSON

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

##  Fields

In addition to the [common fields](/docs/references/protocol/transactions/common-fields),  transactions use the following fields:

| Field Name | JSON Type | Internal Type | Required? | Description |
|  --- | --- | --- | --- | --- |
| `LoanBrokerID` | String | Hash256 | Yes | The ID of the `LoanBroker` ledger entry to withdraw from. |
| `Amount` | [Currency Amount](/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts) | Amount | Yes | The amount of first-loss capital to withdraw. |
| `Destination` | String | AccountID | No | An account to receive the assets. |
| `DestinationTag` | Number | UInt32 | No | An arbitrary tag identifying the reason for the transaction to the destination. |


## Error Cases

Besides errors that can occur for all transactions,  transactions can result in the following [transaction result codes](/docs/references/protocol/transactions/transaction-results):

| Error Code | Description |
|  --- | --- |
| `temINVALID` | The `LoanBrokerID` field is invalid. |
| `temBAD_AMOUNT` | The amount to withdraw is lass than or equal to `0`. |
| `temMALFORMED` | The `Destination` account is empty or `0`. You can also receive this error if the destination tag is set, but `Destination` isn't. |
| `tecNO_ENTRY` | The specified `LoanBroker` ledger entry doesn't exist. |
| `tecWRONG_ASSET` | The withdrawal asset doesn't match the asset in the vault. |
| `tecNO_DST` | The `Destination` provided doesn't exist on the ledger. |
| `tecDST_TAG_NEEDED` | The `Destination` account requires a destination tag. |
| `tecINSUFFICIENT_FUNDS` | There isn't enough first-loss capital to withdraw. |
| `tecFROZEN` | The asset is frozen globally for the `LoanBroker` pseudo-account, or deep frozen for the destination. A regular freeze on the destination alone does not cause this error. _The [fixCleanup3_3_0 amendment](/resources/known-amendments#fixcleanup3_3_0) updates this. (Open for Voting: 34.29%)_ |
| `tecLOCKED` | The MPT asset is locked globally for the `LoanBroker` pseudo-account, for the sender, or for the destination account. Unlike a trust line freeze, an MPT lock also blocks a withdrawal to the sender's own account. _The [fixCleanup3_3_0 amendment](/resources/known-amendments#fixcleanup3_3_0) updates this. (Open for Voting: 34.29%)_ |
| `tecNO_PERMISSION` | The account sending the transaction isn't the owner of the `LoanBroker` ledger entry. |
| `tecPATH_DRY` | The XRP Ledger failed to send the funds to the `Destination`. |