Vault Contracts
Load the current vault and asset addresses from Fund Information before calling these methods.
These methods apply to an escrow_vault fund. A clob fund trades on the orderbook. Use Builder Codes in Trading for that builder fee, and do not call requestDeposit or requestRedeem.
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 builderFeeData, bytes32 referral). Passbytes32(0)forbuilderFeeDatawhen this call does not register a builder. Encoding and approval are in Builder Integration.Wait for settlement.
If not auto-claimed, call
claimDeposit(address receiver, uint256 requestId).claimDepositdoes not takebuilderFeeData.
Direct redemption
Call
requestRedeem(uint256 shares, address receiver, bytes32 builderFeeData, bytes32 referral). Passbytes32(0)forbuilderFeeDatawhen no fee applies. Encoding and approval are in Builder Integration.Wait for settlement.
If a leg was not auto-claimed, call
claimRedeem(address receiver, uint256 requestId)orclaimDelayedRedeem(address receiver, uint256 requestId). These claim calls do not takebuilderFeeData.
Relayed deposit
requestDepositOnBehalf has no builderFeeData argument, and RequestDeposit has no builder-fee field. A relayer cannot attach a builder fee.
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
requestRedeemOnBehalf has no builderFeeData argument, and RequestRedeem has no builder-fee field. A relayer cannot attach a builder fee.
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
Builder IntegrationVault LifecycleLast updated