Get vault capacity

Get vault capacity on ERC4626

Ethereum
Ethereum
Base
Base

Reads onchain state

Ready to run on Base

Reads the most an address can deposit, mint, withdraw, or redeem on an ERC-4626 vault right now. The chosen limit calls the vault's maxDeposit, maxMint, maxWithdraw, or maxRedeem for the wallet, honouring deposit caps, pauses, and the wallet's own share balance. A Morpho Vault V2 answers those views with zero by design, so its limit is worked out instead from its gates, the caps its liquidity adapter allocates under, what that adapter takes and pays, and the wallet's shares. Deposit and withdraw limits are in the asset's units; mint and redeem in shares. Reach for it to clamp an amount with a min before the write so the transaction lands instead of reverting at the cap, or to require the vault accepts at least a target size.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

More plugs on Base

Earn yield on Base · 12 plugs

More on ERC4626 · 9

On other protocols · 1