Aave v3 on Optimism
Deployments
Name | Address |
---|---|
AaveLendingPoolV3 | 0x794a61358D6845594F94dc1DB02A252b5b4814aD (opens in a new tab) |
WrappedTokenGatewayV3 | 0x60eE8b61a13c67d0191c851BEC8F0bc850160710 (opens in a new tab) |
aOptWETH | 0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8 (opens in a new tab) |
variableDebtWETH | 0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351 (opens in a new tab) |
Action: deposit
Parameters
Name | Type | Description |
---|---|---|
targets | string[] (required) | ETH | Token symbols | Token addresses |
Target: ERC-20
For targets that are ERC-20 tokens, the following functions are allowed:
TARGET
below refers to the ERC-20 token address of each element given in
targets
.
TARGET · approve
Approve AaveLendingPoolV3
to spend TARGET
tokens on behalf of the avatar.
-
Contract:
TARGET
-
Function:
approve(address,uint256)
Parameter Constraint spender
equal to AaveLendingPoolV3
amount
-
AaveLendingPoolV3 · supply
Deposit TARGET
and receive aToken
tokens in exchange.
-
Contract:
AaveLendingPoolV3
-
Function:
supply(address,uint256,address,uint16)
Parameter Constraint asset
equal to TARGET
amount
- onBehalfOf
equal to AVATAR
referralCode
-
AaveLendingPoolV3 · setUserUseReserveAsCollateral
Set/unset deposited asset as collateral.
-
Contract:
AaveLendingPoolV3
-
Function:
setUserUseReserveAsCollateral(address,bool)
Parameter Constraint asset
equal to TARGET
useAsCollateral
-
AaveLendingPoolV3 · withdraw
Redeem aToken
and withdraw TARGET
tokens.
-
Contract:
AaveLendingPoolV3
-
Function:
withdraw(address,uint256,address)
Parameter Constraint asset
equal to TARGET
amount
- to
equal to AVATAR
AaveLendingPoolV3 · withdraw(bytes32)
Calldata efficient wrapper of the withdraw function.
Redeem aToken
and withdraw TARGET
tokens.
-
Contract:
AaveLendingPoolV3
-
Function:
withdraw(bytes32)
Parameter Constraint args
Scoped by assetId (see below)
The args
is a 32 bytes parameter, where the first 30 bytes represent
amount
, and the last 2 bytes represent assetId
. Only the last 2 bytes are
scoped to ensure the correct assetId
is used.
For example:
0x0000000000000000000000000000000000000000000000000000000f4240000c
.
amount
: 1000000 (represented by
0x0000000000000000000000000000000000000000000000000000000f4240
).
assetId
: 12 (represented by 0x000c
).
Target: ETH
For "ETH"
as an element of targets
, the following functions are allowed:
aOptWETH · approve
Approve WrappedTokenGatewayV3
to spend aOptWETH
tokens on behalf of the avatar.
-
Contract:
aOptWETH
-
Function:
approve(address,uint256)
Parameter Constraint spender
equal to WrappedTokenGatewayV3
amount
-
WrappedTokenGatewayV3 · depositETH
Deposit ETH and receive aOptWETH
tokens in exchange.
-
Contract:
WrappedTokenGatewayV3
-
Function:
depositETH(address,address,uint16)
Ξ allow sending ETHParameter Constraint address
equal to AaveLendingPoolV3
onBehalfOf
equal to AVATAR
referralCode
-
AaveLendingPoolV3 · setUserUseReserveAsCollateral
Set/unset deposited asset as collateral.
-
Contract:
AaveLendingPoolV3
-
Function:
setUserUseReserveAsCollateral(address,bool)
Parameter Constraint asset
equal to TARGET
useAsCollateral
-
WrappedTokenGatewayV3 · withdrawETH
Redeem aOptWETH
and withdraw ETH tokens.
-
Contract:
WrappedTokenGatewayV3
-
Function:
withdrawETH(address,uint256,address)
Parameter Constraint address
equal to AaveLendingPoolV3
amount
- to
equal to AVATAR
Action: borrow
Parameters:
Name | Type | Description |
---|---|---|
targets | string[] (required) | ETH | Token symbols | Token addresses |
Target: ERC-20
For targets that are ERC-20 tokens, the following functions are allowed:
TARGET
below refers to the ERC-20 token address of each element given in
targets
.
TARGET · approve
Approve AaveLendingPoolV3
to spend TARGET
tokens on behalf of the avatar.
-
Contract:
TARGET
-
Function:
approve(address,uint256)
Parameter Constraint spender
equal to AaveLendingPoolV3
amount
-
AaveLendingPoolV3 · borrow
Receive TARGET
and variableDebtToken
tokens.
-
Contract:
AaveLendingPoolV3
-
Function:
borrow(address,uint256,uint256,uint16,address)
Parameter Constraint asset
equal to TARGET
amount
- interestRateMode
- referralCode
- onBehalfOf
equal to AVATAR
AaveLendingPoolV3 · repay
Repay borrowed TARGET
tokens.
-
Contract:
AaveLendingPoolV3
-
Function:
repay(address,uint256,uint256,address)
Parameter Constraint asset
equal to TARGET
amount
- rateMode
- onBehalfOf
equal to AVATAR
Target: ETH
For "ETH"
as an element of targets
, the following functions are allowed:
variableDebtWETH · approveDelegation
Set the amount of allowance for WrappedTokenGatewayV3
to borrow variableDebtWETH
tokens.
-
Contract:
variableDebtWETH
-
Function:
approveDelegation(address,uint256)
Parameter Constraint delegatee
equal to WrappedTokenGatewayV3
amount
-
WrappedTokenGatewayV3 · borrowETH
Receive ETH and variableDebtWETH
tokens.
-
Contract:
WrappedTokenGatewayV3
-
Function:
borrowETH(address,uint256,uint256,uint16)
Parameter Constraint address
equal to AaveLendingPoolV3
amount
- interestRateMode
- referralCode
-
WrappedTokenGatewayV3 · repayETH
Repay borrowed ETH.
-
Contract:
WrappedTokenGatewayV3
-
Function:
repayETH(address,uint256,uint256,address)
Ξ allow sending ETHParameter Constraint address
equal to AaveLendingPoolV3
amount
- rateMode
- onBehalfOf
equal to AVATAR