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

# Deposit

How to deposit funds into a DeFindex vault through the API. To call the contract directly instead, see [Vault Methods](/advanced-documentation/direct-contract-calls/vault-methods).

## Overview

Deposits allow you to add assets to a vault, with the option to automatically invest them into the vault's strategies or keep them as idle funds. All deposit operations require specifying amounts, user addresses, and slippage parameters.

## Implementation

```typescript theme={null}
const vaultAddress = 'CAQ6PAG4X6L7LJVGOKSQ6RU2LADWK4EQXRJGMUWL7SECS7LXUEQLM5U7';

async function deposit(
  amount: number,
  user: string,
  apiClient: ApiClient,
  signerFunction: (tx: string) => string
) {
  // Step 1: Request an unsigned transaction from the API
  const { xdr: unsignedTx } = await apiClient.postData("deposit", vaultAddress, {
    amounts: [amount],
    caller: user
  });

  // Step 2: Sign the transaction (implement your own signer)
  const signedTx = signerFunction(unsignedTx);

  // Step 3: Send the signed transaction back to the API
  const response = await apiClient.send(signedTx);

  return response;
}
```

## Request Parameters

```javascript theme={null}
{
  amounts: [10000000],     // Array of amounts for each vault asset (7 decimals for XLM)
  caller: userAddress,     // User's wallet address
  invest: true,           // Auto-invest into strategies (recommended: true)
  slippageBps: 50        // 0.5% slippage tolerance (optional, default: 0)
}
```

## Return Values

A deposit returns:

* **Deposited amounts**: The actual amounts deposited for each asset
* **Vault shares minted**: Number of vault shares issued to the depositor
* **Investment allocations** (if `invest = true`): Details of how funds were allocated across strategies
