Redeem

Redeeming is the action of withdrawing underlying assets from a protocol (e.g., a vault or liquidity pool) by exchanging shares or tokens. This action is commonly used to exit a position and retrieve the desired tokens.

ArgumentDescriptionExample
tokenIn(Optional) Address of token to sendtokenIn=0x3b175474e8909...
tokenOutAddress of token to receive. You can define many tokens out by [outToken1, outToken2]tokenOut=0x6b175474e8909...
amountInAmount to deposit in wei (e.g. ERC4626 shares)amountIn=100000000000
primaryAddressAddress of smart contract to interact with (e.g. ERC4626 Vault)primaryAddress=0x7b175474e8909..
recipient(Optional) Address of the receiver if you want to send the tokens to a different address than the smart walletrecipient=0x8b175474e8909...

Example

{
    protocol: "erc4626",
    action: "redeem",
    args: {
        tokenOut: usdt,
        amountIn: shares,
        primaryAddress: erc4626Address,
    },
},