Deposits
Users deposit Aztec tokens and receive stAztec based on the current exchange rate. Deposits go into the buffer pool and are staked on the rollup during the next rebalance.
✅ Recommended: slippage-protected deposit
Always call the 3-argument form of deposit:
function deposit(uint256 assets, address recipient, uint256 minSharesOut)
external
returns (uint256 shares);
minSharesOut is a floor on the share amount the caller is willing to accept. If the exchange rate moves between quoting and execution and the resulting shares would be below minSharesOut, the call reverts with OllaVault__SlippageExceeded.
To quote minSharesOut, call previewDeposit(assets) and apply a tolerance appropriate to your use case (typically 10 to 50 basis points below the quote).
uint256 quoted = vault.previewDeposit(assets);
uint256 minSharesOut = quoted * (10_000 - toleranceBps) / 10_000;
uint256 shares = vault.deposit(assets, recipient, minSharesOut);
✅ Recommended: deposit with permit
If the user has ERC-2612 permit support on Aztec, use the permit variant to save a transaction:
function depositWithPermit(
uint256 assets,
address recipient,
uint256 minSharesOut,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 shares);
The permit call is wrapped in a try/catch. If the permit reverts (for example because someone frontran it), the vault checks whether the allowance is already sufficient and proceeds if it is. Only when both the permit fails and there is no prior allowance does the call revert with OllaVault__PermitFailed.
❌ Compatibility aliases (avoid)
The vault also exposes the standard ERC-4626 2-argument deposit and mint so that generic ERC-4626 tooling compiles:
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
function mint(uint256 shares, address receiver) external returns (uint256 assets);
Neither of these accepts a slippage parameter. A price change between the user signing the transaction and it landing on-chain will be absorbed silently by the caller. Do not wire these into a production integration. They exist only to satisfy the ERC-4626 interface.
If your integration stack depends on the 2-argument signature (for example, an off-the-shelf vault adapter), wrap it so that it always routes to deposit(assets, recipient, minSharesOut).
Preconditions and reverts
A deposit will revert if:
- The vault is paused (
Pausable: paused). - The SafetyModule is paused.
- The deposit cap is exceeded. Use
maxDeposit(address)to check the remaining headroom. assetsis zero, orrecipientis the zero address.shares < minSharesOut(slippage guard, 3-argument variant only).
Related reading
- Function reference: OllaVault
- Sequence diagrams: User Actions
- ERC-4626 method behavior: ERC-4626 Compatibility