Get max withdrawal

Get max withdrawal on Avantis

Base
Base

Reads onchain state

Reads the most stablecoin a wallet can withdraw from the Avantis vault by the vault's own bound. The vault's maxWithdraw is the smaller of the wallet's share value and the headroom left before the reserve behind open trades reaches the withdraw threshold. That headroom is measured against the vault's open interest multiplied balance, so it can exceed what an exit can actually take: the binding check is the utilization the exit would leave, which reverts it at the threshold. Reach for it to clamp a withdrawal to what the vault declares, alongside the utilization ratio and threshold for the exact gate.

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 on Avantis ยท 37