Repay

Aave V2 Action Plugin - Repay

Description

Repays onBehalfOf's debt amount of asset which has a rateMode.

Method

repay(address, uint256, uint256, address)

Input Parameters

No required parameters.

Method Parameters

NamePlugin TypeDescription

asset

FctAddress

Address of the underlying asset

amount

FctValue

Amount to be borrowed. Use -1 to repay the entire debt

rateMode

FctValue

The type of borrow debt. Stable - 1 Variable - 2

onBehalfOf

FctAddress

Address of user who will incur the debt

Returned Values

No returned values

Example

Example with initParams

const repay = new AaveV2.actions.Repay({
   chainId: 1,
   initParams: {
     methodParams: {
       asset: "0x...",
       amount: "100000000",
       rateMode: "1",
       onBehalfOf: "0x..."
     }
   }
})

Example without initParams

const repay = new AaveV2.actions.Repay({ chainId: 1 })

repay.input.set({
    methodParams: {
       asset: "0x...",
       amount: "100000000",
       rateMode: "1",
       onBehalfOf: "0x..."
    }
})

Learn more

Learn more about Aave V2 repay function here

Last updated