> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loopscale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deposit to Earn Vault

Builds the transactions that deposit tokens into an Earn vault and mint vault shares (LP tokens) to the wallet.

The response carries two transactions in `txBase64s`: an AUM refresh followed by the deposit itself. Sign both with the depositing wallet and submit them **in order as one Jito bundle**. The deposit transaction already contains the Jito tip. See [Sending Earn transactions](#sending-earn-transactions) below.

If the vault has `requiresAcknowledgment: true` (see [Get Earn Vault](/api-reference/data/earn/get-earn-vault)), call [Acknowledge Earn Vault](/api-reference/transactions/earn/acknowledge) for the wallet before its first deposit.

## Body

<ParamField body="address" type="string" required>
  Earn vault address.
</ParamField>

<ParamField body="wallet" type="string" required>
  Depositing wallet. It pays fees and signs both transactions.
</ParamField>

<ParamField body="amount" type="string | integer" required>
  Amount to deposit, in base units of the deposit mint (for example `"1000000"` is 1 USDC).
</ParamField>

<ParamField body="mint" type="string">
  Token to deposit. Defaults to the vault's underlying (`acceptedAssetMint`). Must be one of the vault's token entries (`parsedAccountJson` on [Get Earn Vault](/api-reference/data/earn/get-earn-vault)), otherwise the request fails.
</ParamField>

<ParamField body="minLpOut" type="string | integer">
  Minimum shares to receive, in LP base units. The transaction fails if fewer would be minted. Defaults to `0` (no slippage protection).
</ParamField>

<ParamField body="providerKind" type="string" default="exponent">
  Vault provider. Only `exponent` is supported today.
</ParamField>

## Response

<ResponseField name="txBase64s" type="string[]">
  Base64 v0 transactions to sign and send in order as one bundle: `[aumRefresh, deposit]`.
</ResponseField>

<ResponseField name="txBase64" type="string">
  The deposit transaction on its own (the last entry of `txBase64s`).
</ResponseField>

<ResponseField name="action" type="string">
  `deposit`.
</ResponseField>

<ResponseField name="providerKind" type="string">
  Provider that built the transaction.
</ResponseField>

<ResponseField name="vault" type="string">
  Vault address.
</ResponseField>

<ResponseField name="user" type="string">
  Wallet the transaction was built for.
</ResponseField>

<ResponseField name="setupIxs" type="object[]">
  Decoded setup instructions in the deposit transaction (compute budget, heap frame, Jito tip, token account creation).
</ResponseField>

<ResponseField name="ixs" type="object[]">
  Decoded vault instructions in the deposit transaction.
</ResponseField>

<ResponseField name="luts" type="string[]">
  Address lookup tables the deposit transaction uses.
</ResponseField>

<ResponseField name="signers" type="string[]">
  Extra signers that already signed the deposit transaction. Empty for deposits.
</ResponseField>

<ResponseField name="missingLuts" type="string[]">
  Lookup tables that could not be loaded. Diagnostic only.
</ResponseField>

<ResponseField name="accountsNotInLuts" type="string[]">
  Accounts passed outside lookup tables. Diagnostic only.
</ResponseField>

<RequestExample>
  ```bash Example theme={null}
  curl -X POST https://tars.loopscale.com/v1/pandora/earn/vaults/deposit/tx \
    -H "Content-Type: application/json" \
    -d '{
      "address": "EsTx9ToYW2k1DsTw6ccpmP3RrXQriod114hcM7U5ZKaR",
      "wallet": "<WALLET>",
      "amount": "1000000"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "providerKind": "exponent",
    "action": "deposit",
    "vault": "EsTx9ToYW2k1DsTw6ccpmP3RrXQriod114hcM7U5ZKaR",
    "user": "<WALLET>",
    "setupIxs": [{ "programId": "ComputeBudget111111111111111111111111111111", "accounts": [], "data": "..." }],
    "ixs": [{ "programId": "sVau1tXvayVWfotzm9Ahcv2qfnnfRWttt78BCnNC6dD", "accounts": ["..."], "data": "..." }],
    "luts": ["EmzYGKrZEyLvaRbmJGV5cdCqNjdPKpH62oscdGD7oui6"],
    "missingLuts": [],
    "accountsNotInLuts": ["..."],
    "signers": [],
    "txBase64": "<DEPOSIT_TX>",
    "txBase64s": ["<AUM_REFRESH_TX>", "<DEPOSIT_TX>"]
  }
  ```
</ResponseExample>

## Sending Earn transactions

Every Earn transaction endpoint (deposit, withdraw request, claim, cancel) returns the same shape:

1. Deserialize each entry of `txBase64s` as a `VersionedTransaction`.
2. Sign each one with the wallet. Keep any signatures already present: a queued withdraw request comes partially signed by its new request account (listed in `signers`).
3. Submit the signed transactions **in the order returned** as a single Jito bundle. The first refreshes the vault's AUM so the action is priced at current NAV. The last carries the Jito tip. Sending the action alone, or out of order, can fail or price against stale NAV.

Transactions use a recent blockhash from build time, so sign and send promptly.

## Errors

If a transaction can't be built, the endpoint returns `500` with `error.code`, `error.message`, and the `accountsNotInLuts` and `missingLuts` diagnostics.
