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

# Token to Vault

> Deposit any token into a vault with a single signature

Turn any token into a vault position with one click. Users don't need to hold the vault's underlying asset—Biconomy handles the swap and deposit atomically.

## The Problem It Solves

Without Biconomy, depositing into a vault requires:

1. Swap your token to the vault's asset *(signature 1)*
2. Approve the vault contract *(signature 2)*
3. Deposit into the vault *(signature 3)*
4. If cross-chain: bridge first *(add 2 more signatures)*

**With Biconomy:** One signature. Automatic routing to the best path.

## How It Works

<Steps>
  <Step title="User Selects Destination">
    User chooses a vault to deposit into (AAVE, Morpho, Yearn, etc.)
  </Step>

  <Step title="API Finds Optimal Route">
    Biconomy calculates the best path: swap → bridge (if needed) → deposit
  </Step>

  <Step title="User Signs Once">
    Single signature approves the entire flow
  </Step>

  <Step title="Lossless Execution">
    Direct vault deposit operations—no slippage on the final step
  </Step>
</Steps>

## Quick Example

Deposit USDC on Base into an AAVE vault:

```typescript theme={null}
const quote = await fetch('https://api.biconomy.io/v1/quote', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    mode: 'eoa',
    ownerAddress: userAddress,
    composeFlows: [{
      type: '/instructions/intent-vault',
      data: {
        srcChainId: 8453,           // Base
        srcToken: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913',  // USDC
        dstChainId: 8453,           // Same chain
        dstVault: '0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB',  // AAVE vault
        amount: '1000000000',       // 1,000 USDC
        slippage: 0.01              // 1%
      }
    }]
  })
}).then(r => r.json());

// Sign the payload
const signature = await wallet.signTypedData(quote.typedDataToSign);

// Execute
const result = await fetch('https://api.biconomy.io/v1/execute', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    signedQuote: quote,
    signature
  })
}).then(r => r.json());

console.log('Track at:', `https://meescan.biconomy.io/details/${result.supertxHash}`);
```

## Cross-Chain Deposit

Deposit from one chain into a vault on another:

```typescript theme={null}
const quote = await fetch('https://api.biconomy.io/v1/quote', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    mode: 'eoa',
    ownerAddress: userAddress,
    composeFlows: [{
      type: '/instructions/intent-vault',
      data: {
        srcChainId: 1,              // Ethereum
        srcToken: USDC_ETH,         // USDC on Ethereum
        dstChainId: 8453,           // Base
        dstVault: MORPHO_VAULT,     // Morpho vault on Base
        amount: '10000000000',      // 10,000 USDC
        slippage: 0.01,
        allowBridgeProviders: 'across'  // Prefer Across for speed
      }
    }]
  })
}).then(r => r.json());
```

Biconomy automatically:

* Bridges USDC from Ethereum to Base
* Deposits directly into the Morpho vault
* All in a single user signature

## Understanding the Response

```json theme={null}
{
  "outputAmount": "990000000000000000",
  "minOutputAmount": "980100000000000000",
  "route": {
    "type": "token-to-vault",
    "summary": "lifi[sushiswap] => vaultsfyi[aave-v3]",
    "steps": [
      {
        "type": "swap",
        "provider": "lifi",
        "tool": "sushiswap",
        "srcToken": { "symbol": "USDC" },
        "dstToken": { "symbol": "WETH" }
      },
      {
        "type": "vault-deposit",
        "provider": "vaultsfyi",
        "protocol": "aave-v3",
        "vaultName": "AAVE WETH"
      }
    ],
    "estimatedTime": 30
  }
}
```

| Field             | Description                           |
| ----------------- | ------------------------------------- |
| `route.type`      | Always `token-to-vault` for this flow |
| `outputAmount`    | Expected vault shares to receive      |
| `minOutputAmount` | Minimum after slippage protection     |
| `route.steps`     | Each operation in sequence            |

## Supported Protocols

<CardGroup cols={2}>
  <Card title="Lending Markets" icon="building-columns">
    AAVE, Compound, Morpho, Venus, Spark, Radiant
  </Card>

  <Card title="Yield Vaults" icon="vault">
    Yearn, Beefy, Convex, Sommelier, Enzyme
  </Card>

  <Card title="Liquid Staking" icon="water">
    Lido, Rocket Pool, Frax, Stakewise
  </Card>

  <Card title="DEX LP" icon="droplet">
    Uniswap, Curve, Balancer, Velodrome, Aerodrome
  </Card>
</CardGroup>

## Fee Structure

| Scenario                   | Fee (BPS) |
| -------------------------- | --------- |
| Same-chain, no swap needed | 0         |
| Same-chain with swap       | 10        |
| Cross-chain deposit        | 15        |

<Tip>
  When the source token matches the vault's underlying asset, no swap is needed—resulting in zero fees for the vault operation.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Vault to Token" icon="arrow-right-from-bracket" href="/zaps/vault-to-token">
    Withdraw from vaults to any token
  </Card>

  <Card title="Vault to Vault" icon="arrows-rotate" href="/zaps/vault-to-vault">
    Migrate positions between vaults
  </Card>
</CardGroup>
