Withdraw

Yearn Action Plugin - Withdraw

Description

Withdraws the calling account's tokens from this Vault, redeeming amount _shares for an appropriate amount of tokens. See note on setWithdrawalQueue for further details of withdrawal ordering and behavior.

Method

deposit(uint256, address)

Input Parameters

NamePlugin TypeDescription

to

FctAddress

yVault address

Method Parameters

NamePlugin TypeDescription

maxShares

FctValue

How many shares to try and redeem for tokens

recipient

FctAddress

The address to issue the shares in this Vault to

maxLoss

FctValue

The maximum acceptable loss to sustain on withdrawal

Returned Values

No values get returned

Example

Example with initParams

const withdraw = new Yearn.actions.Withdraw({
   chainId: 1,
   initParams: {
     to: "0xa258C4606Ca8206D8aA700cE2143D7db854D168c", // wETH yVault
     methodParams: {
       maxShares: "100000",
       recipient: "0x...",
       maxLoss: "5000"
     }
   }
})

Example without initParams

const withdraw = new Yearn.actions.Withdraw({ chainId: 1 })

withdraw.input.set({
     to: "0xa258C4606Ca8206D8aA700cE2143D7db854D168c", // wETH yVault
     methodParams: {
       maxShares: "100000",
       recipient: "0x...",
       maxLoss: "5000"
     }
})

Learn more

Learn more about Yearn yVault withdraw method here

Last updated