Preview redemption

Preview redemption on Avantis

Base
Base

Reads onchain state

Reads how much stablecoin redeeming an exact number of Avantis vault shares would pay right now. The vault's previewRedeem converts the shares at its current rate and takes the collateral health fee off, rounding down, so it is exactly what the redemption pays in the same block. It does not check the utilization gate, which can still revert the exit. Reach for it to set a floor before redeeming, or to gate an exit on the fee having fallen by comparing it with the fee free conversion.

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

On other protocols ยท 1