Deposits a specified number of assets into a vault in exchange for shares.
For private vaults, the depositor must be authorized to interact with the vault’s shares and have Credentials in the Permissioned Domain of the share.
Public vaults require no authorization, and anyone can deposit as long as they meet the asset type requirement and have sufficient funds.
A depositor cannot deposit assets into the vault if:
- The asset is frozen for the depositor.
- The trust line between the pseudo-account and the issuer is frozen, or the
MPTokenis locked. - The vault is private and the depositor's credentials have expired.
If successful, the transaction moves the assets from the depositor's account to the vault's pseudo-account, issues the corresponding vault shares, and updates the vault’s balance.
SingleAssetVault amendmentが必要です。 Loading...
LendingProtocolV1_1 amendmentが必要です。 Loading...
{
"TransactionType": "VaultDeposit",
"Account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
"Fee": "12",
"Flags": 0,
"LastLedgerSequence": 7108682,
"Sequence": 8,
"VaultID": "77D6234D074E505024D39C04C3F262997B773719AB29ACFA83119E4210328776",
"Amount" : {
"currency" : "TST",
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
"value" : "2.5"
}
}In addition to the common fields, VaultDeposit transactions use the following fields:
| Field Name | JSON Type | Internal Type | Required? | Description |
|---|---|---|---|---|
VaultID | String | Hash256 | Yes | The unique identifier of the vault to which the asset is deposited. |
Amount | Currency Amount | Amount | Yes | The asset and quantity to be deposited into the vault. |
The deposited asset must match the vault’s designated asset for the transaction to succeed. Depending on the asset type, the following changes occur:
- XRP: The vault’s pseudo-account balance increases, and the depositor’s balance decreases.
- Trust line token: The trust line balance between the vault's pseudo-account and the asset issuer is adjusted.
- MPT: The
MPToken.MPTAmountof both the depositor and the vault's pseudo-account is updated.
The deposit amount is rounded down to match the vault's AssetsTotal precision, so the vault's total and available balances change by a representable amount.
fixCleanup3_4_0 amendmentが必要です。 Loading...
There are no flags defined for VaultDeposit transactions.
A single asset vault does not apply the transfer fee to VaultDeposit transactions. Additionally, whenever a protocol moves assets from or to a vault, the transfer fee isn't charged.
Besides errors that can occur for all transactions, VaultDeposit transactions can result in the following transaction result codes:
| Error Code | Description |
|---|---|
tecEXPIRED | The vault is closed-ended and in its Investment or Redemption phase. LendingProtocolV1_1 amendmentが必要です。 Loading... |
tecFROZEN | The vault asset is frozen globally for the depositor, or for the vault's pseudo-account. Both regular and deep freezes cause this error. fixCleanup3_3_0 amendmentが必要です。 Loading... |
tecINSUFFICIENT_FUNDS | The depositor does not have sufficient funds to make a deposit. |
tecLIMIT_EXCEEDED | Adding the provided Amount to the AssetsTotal exceeds the AssetsMaximum value. |
tecLOCKED | The MPT vault asset is locked globally for the depositor, or for the vault's pseudo-account. fixCleanup3_3_0 amendmentが必要です。 Loading... |
tecNO_AUTH | Either the vault is private and the depositing account does not have credentials in the share's Permissioned Domain, or the asset is a non-transferable MPT. |
tecNO_ENTRY | The Vault object with the provided VaultID does not exist on the ledger. |
tecOBJECT_NOT_FOUND | A ledger entry specified in the transaction does not exist. |
tecPATH_DRY | Converting the deposit into shares overflowed the largest number the protocol can represent. This usually means the vault's Scale is high and the Amount is large. |
tecPRECISION_LOSS | The deposit rounds to nothing, either at the vault's scale, at the depositor's trust line scale, or when converted into shares. fixCleanup3_2_0 amendmentが必要です。 Loading... fixCleanup3_4_0 amendmentが必要です。 Loading... |
tecWRONG_ASSET | The asset of the vault does not match the asset being deposited. |
temBAD_AMOUNT | The Amount field of the transaction is invalid. |
temDISABLED | The SingleAssetVault amendment is not enabled. |
temMALFORMED | The transaction was not validly formatted. For example, if the VaultID is not provided. |