For most use cases, use the unified deposit workflow which handles authorization automatically.
Import
Usage
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
yieldType | YieldType | Yes | Yield strategy type (CORE, TREASURY, or FRONTIER) |
depositAsset | Address | Yes | Token contract address to deposit |
depositAmount | string | Yes | Amount to deposit as decimal string (e.g., "100.50") |
to | Address | Yes | Recipient address for vault shares |
chainId | number | Yes | Blockchain network ID |
slippage | number | No | Slippage tolerance in basis points (default: 50 = 0.5%) |
partnerCode | string | No | Partner code for fee attribution |
Return Type
- Type Definition
- Example Response
Examples
- Privy
- Wagmi
- Viem
Slippage Configuration
The default slippage is 50 basis points (0.5%). Adjust for volatile conditions:Error Handling
| Error Code | Description | Resolution |
|---|---|---|
SDK_NOT_INITIALIZED | SDK not initialized | Call initAmplifySDK() first |
VAULT_NOT_FOUND | No vault matches parameters | Verify yieldType, token, chainId |
INSUFFICIENT_ALLOWANCE | Token not approved | Call approval first or use permit flow |
INVALID_AMOUNT | Amount is zero or negative | Provide valid positive amount |
Related
- Deposit Workflow - Unified deposit API
- prepareDepositWithPermitTxData - Permit-based deposits
- Deposits Guide - Complete examples