Redeem

Compound V2 Action Plugin - Redeem

Description

The redeem function converts a specified quantity of cTokens into the underlying asset, and returns them to the user.

Method

redeem(uint256)

Input Parameters

NamePlugin TypeSolidity TypeDescription

to

FctAddress

address

cToken address

Method Parameters

NamePlugin TypeSolidity TypeDescription

redeemTokens

FctValue

uint256

Amount to redeem

Returned Values

NamePlugin TypeSolidity TypeDescription

result

FctValue

uint256

If result is 0 - success

Example

Example with initParams

const redeem = new CompoundV2.actions.Redeem({
   chainId: 1,
   initParams: {
     to: "0x39AA39c021dfbaE8faC545936693aC917d5E7563"
     methodParams: {
       redeemTokens: "100000"
     }
   }
})

Example without initParams

const redeem = new CompoundV2.actions.Redeem({ chainId: 1 })

redeem.input.set({
     to: "0x39AA39c021dfbaE8faC545936693aC917d5E7563"
     methodParams: {
       redeemTokens: "100000"
     }
})

Learn more

Learn more about Compound V2 Redeem method here

Last updated