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

# Portfolio Deposit

> Generate transaction data for depositing assets into a portfolio

Generates transaction data for depositing assets into a portfolio.

<ParamField path="portfolioId" type="string" required>
  The unique identifier of the portfolio
</ParamField>

<ParamField body="tokenContractAddress" type="string" required>
  The contract address of the token to deposit, or "native" for ETH
</ParamField>

<ParamField body="tokenChainId" type="number" required>
  The chain ID where the token exists (e.g., 8453 for Base)
</ParamField>

<ParamField body="tokenAmount" type="string" required>
  The amount to deposit in base units (e.g., wei for ETH, without decimals)
</ParamField>

<ParamField body="userWalletAddress" type="string">
  Optional custom sender address (defaults to the portfolio owner address)
</ParamField>

<ParamField body="simulate" type="boolean" default="false">
  Whether to perform full transaction simulation and gas estimation
</ParamField>

<ParamField header="X-API-KEY" type="string" required>
  Your API key for authentication
</ParamField>

<ParamField header="Content-Type" type="string" default="application/json">
  The format of the request body
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  # Deposit ETH
  curl --request POST \
    --url 'https://api.glider.fi/v1/portfolio/port_abc123/deposit' \
    --header 'Content-Type: application/json' \
    --header 'X-API-KEY: your_api_key_here' \
    --data '{
      "tokenContractAddress": "native",
      "tokenChainId": 8453,
      "tokenAmount": "100000000000000000",
      "userWalletAddress": "0xCustomSenderAddress",
      "simulate": false
    }'

  # Deposit USDC
  curl --request POST \
    --url 'https://api.glider.fi/v1/portfolio/port_abc123/deposit' \
    --header 'Content-Type: application/json' \
    --header 'X-API-KEY: your_api_key_here' \
    --data '{
      "tokenContractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "tokenChainId": 8453,
      "tokenAmount": "1000000",
      "userWalletAddress": "0xCustomSenderAddress",
      "simulate": false
    }'
  ```

  ```javascript JavaScript theme={null}
  // Deposit ETH
  const depositResponse = await fetch(
    `https://api.glider.fi/v1/portfolio/${portfolioId}/deposit`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "X-API-KEY": "your_api_key_here",
      },
      body: JSON.stringify({
        tokenContractAddress: "native", // "native" for ETH
        tokenChainId: 8453, // Base
        tokenAmount: "100000000000000000", // Amount in base units (0.1 ETH = 10^17 wei)
        userWalletAddress: "0xCustomSenderAddress", // Optional: Specify the sender address
        simulate: false, // By default, returns a lightweight tx object without simulation
      }),
    }
  );

  const depositData = await depositResponse.json();

  // When simulate=false (default), the response includes depositRequest info
  console.log("Deposit to vault:", depositData.data.depositRequest.vaultAddress);
  console.log("Token:", depositData.data.depositRequest.token);
  console.log("Amount:", depositData.data.depositRequest.amount);

  // Execute the deposit transaction with your wallet
  const depositTxHash = await wallet.sendTransaction({
    to: depositData.data.tx.to,
    data: depositData.data.tx.data,
    value: depositData.data.tx.value,
  });
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "portfolioId": "port_abc123",
      "depositRequest": {
        "vaultAddress": "0xPortfolioVaultAddress",
        "token": "native",
        "amount": "100000000000000000"
      },
      "tx": {
        "to": "0xPortfolioVaultAddress",
        "data": "0x",
        "value": "100000000000000000"
      },
      "chainId": "8453",
      "message": "Deposit transaction data generated successfully"
    },
    "correlationId": "corr_abc123",
    "requestId": "req_xyz789",
    "timestamp": "2023-05-21T13:45:12.345Z"
  }
  ```
</ResponseExample>
