Import
Usage
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
yieldType | YieldType | Yes | Yield strategy type (CORE, TREASURY, or FRONTIER) |
offerAmount | string | Yes | Amount of shares to burn as decimal string |
wantAssetAddress | Address | Yes | Token address the user wants to receive |
chainId | number | Yes | Blockchain network ID |
slippage | number | No | Slippage tolerance in basis points (default: 50) |
Return Type
- Type Definition
- Example Response
Examples
- Privy
- Wagmi
- Viem
Slippage Configuration
Adjust slippage for withdrawal price tolerance:Complete Withdrawal Hook
Error Handling
| Error Code | Description | Resolution |
|---|---|---|
SDK_NOT_INITIALIZED | SDK not initialized | Call initAmplifySDK() first |
VAULT_NOT_FOUND | No vault matches parameters | Verify yieldType, chainId |
INSUFFICIENT_SHARES | Not enough vault shares | Check user’s share balance |
NOT_APPROVED | Withdrawal not approved | Call prepareApproveWithdrawTxData first |
SLIPPAGE_EXCEEDED | Price moved beyond tolerance | Increase slippage or retry |
Related
- prepareApproveWithdrawTxData - Approve withdrawals
- Withdrawals Guide - Complete examples
- Smart Wallets Guide - Batched withdrawals