# VaultDeposit [[Source]](https://github.com/Bronek/rippled/blob/vault/src/xrpld/app/tx/detail/VaultDeposit.cpp) 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](https://xrpl.org/docs/concepts/networks-and-servers/rippled-server-modes#stand-alone-mode) and enable `LendingProtocol` and `SingleAssetVault` in the [rippled.cfg file](https://xrpl.org/docs/infrastructure/testing-and-auditing/test-amendments). 2. Connect to the Lending Protocol-specific Devnet at `https://lend.devnet.rippletest.net:51234/`. 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](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0070-credentials) in the [Permissioned Domain](https://github.com/XRPLF/XRPL-Standards/blob/master/XLS-0080-permissioned-domains/) 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. Warning A depositor cannot deposit assets into the vault if: - The asset is frozen for the depositor. - The trust line or the `MPToken` between the pseudo-account and the issuer of the vault asset is frozen or 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. *(Requires the [Single Asset Vault amendment](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0065-single-asset-vault) )* ## Example JSON ```json { "TransactionType": "VaultDeposit", "Account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "Fee": "12", "Flags": 0, "LastLedgerSequence": 7108682, "Sequence": 8, "VaultID": "77D6234D074E505024D39C04C3F262997B773719AB29ACFA83119E4210328776", "Amount" : { "currency" : "TST", "issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd", "value" : "2.5" } } ``` ## Fields In addition to the [common fields](https://xrpl.org/docs/references/protocol/transactions/common-fields#transaction-common-fields), 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` | Object | 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. - **Fungible Token**: The [trust line](https://xrpl.org/docs/concepts/tokens/fungible-tokens#trust-lines) balance between the vault's pseudo-account and the asset issuer is adjusted. - **MPT**: The `MPToken.MPTAmount` of both the depositor and the vault's pseudo-account is updated. ## Flags There are no flags defined for transactions. ## Transfer Fees A single asset vault does not apply the [transfer fee](https://xrpl.org/docs/concepts/tokens/transfer-fees) to transactions. Additionally, whenever a protocol moves assets from or to a vault, the transfer fee isn't charged. ## Error Cases Besides errors that can occur for all transactions, transactions can result in the following [transaction result codes](https://xrpl.org/docs/references/protocol/transactions/transaction-results): | Error Code | Description | | --- | --- | | `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. | | `tecWRONG_ASSET` | The asset of the vault does not match the asset being deposited. | | `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. | | `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. | | `tecFROZEN` | Either the trust line between the issuer and the depositor is frozen, or the asset is globally frozen. | | `tecLOCKED` | Either the MPT asset is locked for the depositor, or if the asset is globally locked. | | `temMALFORMED` | The transaction was not validly formatted. For example, if the `VaultID` is not provided. | | `temDISABLED` | The Single Asset Vault amendment is not enabled. | | `temBAD_AMOUNT` | The `Amount` field of the transaction is invalid. |