Vault Contracts
Load the current vault and asset addresses from Fund Information before calling these methods.
Read methods
getAsset()
Return the underlying token address.
getMinDepositAmount()
Return the minimum raw asset amount accepted by a deposit request.
getMinRedeemShares()
Return the minimum vault-share amount accepted by a redemption request.
getNextDepositRequestId()
Return the next deposit request identifier.
getUserDepositIds(address user)
Return the user's deposit request identifiers.
balanceOf(address account)
Return the user's settled ERC-20 vault-share balance.
Direct deposit
Approve the underlying asset for the vault.
Call
requestDeposit(uint256 assets, address receiver, bytes32 referral).Wait for settlement.
If not auto-claimed, call
claimDeposit(address receiver, uint256 requestId).
Relayed deposit
Two signatures are required:
ERC-2612 permit on the underlying asset, with spender = vault. Failures are swallowed, so a prior approve also works and the permit can be empty/0x.
Vault EIP-712 RequestDeposit, using the vault DOMAIN_SEPARATOR() (name = vault.name(), version = "1"). nonce is vault.nonces(onBehalf).
On-chain flow: _useNonce(onBehalf) → best-effort asset.permit(...) → verify RequestDeposit → _requestDeposit(assets, onBehalf, onBehalf, referral), which pulls assets from onBehalf and calls market.swapForShares.
Method
RequestDeposit fields, in order: owner: address, assets: uint256, nonce: uint256, deadline: uint256, referral: bytes32.
Relayed redemption
Only one signature is needed: Vault EIP-712 RequestRedeem. The vault uses internal _transfer(onBehalf, vault, shares), so no share approve / permit is required.
On-chain flow: _useNonce(onBehalf) → verify RequestRedeem → _requestRedeem(shares, onBehalf, onBehalf, referral), which moves shares to the vault and calls market.swapForAssets.
Method
RequestRedeem fields, in order: owner: address, shares: uint256, nonce: uint256, deadline: uint256, referral: bytes32.
Both vault requests use domain.name = vault.name(), version = "1", the current chain ID, the vault as verifyingContract, and vault.nonces(onBehalf).
Integration guide
Vault LifecycleLast updated