Vaults & Vault Names
- Vault – On-chain contract that issues ERC-20 shares representing a position in an underlying strategy.
- Vault Name – A human-readable string identifier (
AmplifyVault.name) used to address a specific vault in all transaction functions. CallgetVaultsByConfig()to discover vault names. - Yield Type – Logical grouping of vaults with similar mandates, exposed as the
YieldTypeenum (CORE,TREASURY,FRONTIER). Used as a filter when discovering vaults, not as a transaction parameter. - Want Asset – Token users receive when withdrawing from a vault; often different from the deposit token.
Vault Discovery Pattern
getSupportedAssets() to discover eligible deposit tokens and chain IDs.
Shares vs. Assets
- Deposits mint shares to the recipient. Shares track ownership of the vault.
- Withdrawals burn shares and return the want asset using
prepareWithdrawal. - Helpers return base-unit values; you provide the human-readable amounts as decimal strings.
Allowances vs. Permits
- Unified API (Recommended): Use
prepareDepositAuthorization()to automatically detect the optimal method. It returns the appropriate flow based on token support and existing allowances. - Approval flow: Traditional ERC20 approval using
prepareApproveDepositTokenTxData()followed byprepareDepositTxData(). - Permit flow: When the token supports EIP-2612, sign typed data off-chain and use
prepareDepositWithPermitTxData()for gas-efficient single-transaction deposits.
Slippage Controls
- Slippage is expressed in basis points (bps). For example,
100means 1%. - Deposit helpers default to 50 bps (0.5%).
- WithdrawQueue-based withdrawals do not require slippage or deadline parameters.
- Helpers return minimum acceptable amounts in base units; you can override or disable slippage (not recommended for production).
Execution Responsibilities
- The SDK prepares calldata only; your app decides which signing stack executes it.
- Use viem, wagmi, Privy, or custody flows to send the transaction.
- Handle errors by catching
APIError, which includes anendpointproperty (e.g.,prepareDepositWithPermitTxData).
Withdrawals
- Use
prepareWithdrawalAuthorizationto determine whether approval is required. - Use
prepareWithdrawalto build the withdrawal order transaction. - For lower-level control, use
prepareWithdrawOrderTxDataandprepareApproveWithdrawOrderTxData.
Cache & Initialization
The SDK caches vault and asset data on startup. For guaranteed fast first calls:waitForCacheReady(), the first call that needs vault data will trigger a cache refresh automatically.
Keep these concepts in mind while following the Quickstart or diving into the API Reference.