Aave V3 - Optimism

Lending & Borrowing. AaveV3-v1.2 connector on optimism triggers methods like deposit, depositWithoutCollateral, withdraw, borrow, borrowOnBehalfOf, payback, paybackWithATokens, paybackOnBehalfOf, enableCollateral, disableCollateral, swapBorrowRateMode, setUserEMode, delegateBorrow. You can view details like source code, ABIs on Etherscan.

  • Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee to indicate ETH.
  • use -1 or dsa.maxValue for the maximum amount in function.
  • If not sure about the arguments getId and setId, pass 0.

Deposit

Deposit a token to Aave v3 for lending / collaterization.

spells.add({  connector: "AAVE-V3-A",  method: "deposit",  args: [token, amt, getId, setId]});
Parameter Type Description
token address The address of the token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
amt uint256 The amount of the token to deposit. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens deposited.

DepositWithoutCollateral

Deposit a token to Aave v3 without enabling it as collateral.

spells.add({  connector: "AAVE-V3-A",  method: "depositWithoutCollateral",  args: [token, amt, getId, setId]});
Parameter Type Description
token address The address of the token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
amt uint256 The amount of the token to deposit. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens deposited.

Withdraw

Withdraw deposited token from Aave v3

spells.add({  connector: "AAVE-V3-A",  method: "withdraw",  args: [token, amt, getId, setId]});
Parameter Type Description
token address The address of the token to withdraw.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
amt uint256 The amount of the token to withdraw. (For max: `uint256(-1)`)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens withdrawn.

Borrow

Borrow a token using Aave v3

spells.add({  connector: "AAVE-V3-A",  method: "borrow",  args: [token, amt, rateMode, getId, setId]});
Parameter Type Description
token address The address of the token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
amt uint256 The amount of the token to borrow.
rateMode uint256 The type of debt. (For Stable: 1, Variable: 2)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens borrowed.

BorrowOnBehalfOf

Borrow a token using Aave v3 on behalf of a user

spells.add({  connector: "AAVE-V3-A",  method: "borrowOnBehalfOf",  args: [token, amt, rateMode, onBehalfOf, getId, setId]});
Parameter Type Description
token address The address of the token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
amt uint256 The amount of the token to borrow.
rateMode uint256 The type of debt. (For Stable: 1, Variable: 2)
onBehalfOf address The user who will incur the debt
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens borrowed.

Payback

Payback debt owed.

spells.add({  connector: "AAVE-V3-A",  method: "payback",  args: [token, amt, rateMode, getId, setId]});
Parameter Type Description
token address The address of the token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
amt uint256 The amount of the token to payback. (For max: `uint256(-1)`)
rateMode uint256 The type of debt paying back. (For Stable: 1, Variable: 2)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens paid back.

PaybackWithATokens

Repays a borrowed amount on a specific reserve using the reserve aTokens, burning the equivalent debt tokens.

spells.add({  connector: "AAVE-V3-A",  method: "paybackWithATokens",  args: [token, amt, rateMode, getId, setId]});
Parameter Type Description
token address The address of the token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
amt uint256 The amount of the token to payback. (For max: `uint256(-1)`)
rateMode uint256 The type of debt paying back. (For Stable: 1, Variable: 2)
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens paid back.

PaybackOnBehalfOf

Payback debt owed on behalf os a user.

spells.add({  connector: "AAVE-V3-A",  method: "paybackOnBehalfOf",  args: [token, amt, rateMode, onBehalfOf, getId, setId]});
Parameter Type Description
token address The address of the token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
amt uint256 The amount of the token to payback. (For max: `uint256(-1)`)
rateMode uint256 The type of debt paying back. (For Stable: 1, Variable: 2)
onBehalfOf address Address of user who's debt to repay.
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens paid back.

EnableCollateral

Enable an array of tokens as collateral

spells.add({  connector: "AAVE-V3-A",  method: "enableCollateral",  args: [tokens]});
Parameter Type Description
tokens address[] Array of tokens to enable collateral

DisableCollateral

Disable an array of tokens as collateral

spells.add({  connector: "AAVE-V3-A",  method: "disableCollateral",  args: [tokens]});
Parameter Type Description
tokens address[] Array of tokens to disable as collateral

SwapBorrowRateMode

Swaps user borrow rate mode between variable and stable

spells.add({  connector: "AAVE-V3-A",  method: "swapBorrowRateMode",  args: [token, rateMode]});
Parameter Type Description
token address The address of the token to swap borrow rate.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
rateMode uint256 Current borrow rate (Stable = 1, Variable = 2)

SetUserEMode

Updates the user's e-mode category

spells.add({  connector: "AAVE-V3-A",  method: "setUserEMode",  args: [categoryId]});
Parameter Type Description
categoryId uint8 The category Id of the e-mode user want to set

DelegateBorrow

Gives approval to delegate debt tokens

spells.add({  connector: "AAVE-V3-A",  method: "delegateBorrow",  args: [token, amount, rateMode, delegateTo, getId, setId]});
Parameter Type Description
token address The address of token
amount uint256 The amount
rateMode uint256 The type of debt
delegateTo address The address to whom the user is delegating
getId uint256 ID to retrieve amt.
setId uint256 ID stores the amount of tokens delegated.

If you still can't find something you're looking for or have any questions, ask them at our developers community on Discord or simply send an Email.


Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.