Deposit

Aave V2 Action Plugin - Deposit

Description

Deposits a certain amount of an asset into the protocol, minting the same amount of corresponding aTokens, and transferring them to the onBehalfOf address.

Method

deposit(address, uint256, address, uint16)

Input Parameters

No required parameters.

Method Parameters

NamePlugin TypeDescription

asset

FctAddress

Address of the underlying asset

amount

FctValue

Amount deposited

onBehalfOf

FctAddress

Address whom will receive the aTokens.

referralCode (optional)

FctValue16

No longer supported by Aave

Returned Values

No value returned

Example

Example with initParams

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

Example without initParams

const deposit = new AaveV2.actions.Deposit({ chainId: 1 })

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

Learn more

Learn more about Aave V2 deposit function here

Last updated