Vaults & Yield Types
- Vault – On-chain contract that issues ERC-20 shares representing a position in an underlying strategy.
- Yield Type – Logical grouping of vaults with similar mandates, exposed as the
YieldTypeenum (CORE,PRIME, etc.). - Want Asset – Token users receive when withdrawing from a vault; often different from the deposit token.
fetchVaults to discover active vault configurations, eligible assets, 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
prepareWithdrawTxData. - Helpers return base-unit values; you provide the human-readable amounts as decimal strings.
Allowances vs. Permits
- Default flow: users approve the Boring Vault contract to spend their deposit token using
prepareApproveDepositToken. - Permit flow: when the token supports EIP-2612,
prepareDepositPermitSignatureproduces typed data for a signature that replaces the approval step.
Slippage Controls
- Slippage is expressed in basis points (bps). For example,
100means 1%. - Deposit helpers default to
DEFAULT_DEPOSIT_SLIPPAGE, while withdraw helpers accept custom tolerance. - 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
prepareWithdrawTxDataburns shares and redeems the want asset in a single transaction when on-chain liquidity is sufficient.- Surface slippage tolerance and eligibility checks so users know when immediate redemption is available.