Compound v3 on Ethereum
Deployments
ETH is not supported directly through DeFi Kit actions
The permissions listed for the actions do not support the use of ETH. Use WETH
instead.
This is why the actions include the permission to wrap ETH into WETH
and unwrap WETH
into ETH when needed.
ETH usage in Compound v3 requires the MainnetBulker (opens in a new tab),
which handles ETH by using the invoke(bytes32[] actions, bytes[] data)
function.
However, this function cannot be included in permission policies at the moment
due to a current limitation in the zodiac-sdk
.
Action: deposit
Parameters
Name | Type | Description |
---|---|---|
targets | string[] (required) | Comet symbols | Comet addresses |
tokens | string[] (optional) | Token symbols | Token addresses |
TARGET_COMET
below refers to the address of the Comet
.
TOKEN
refers to the ERC-20 token address of each element in tokens
. If
tokens
is not provided, all collateral tokens and the base token of the
corresponding TARGET_COMET
will be considered.
TOKEN · approve
Approve TARGET_COMET
to spend TOKEN
tokens on behalf of the avatar.
-
Contract:
TOKEN
-
Function:
approve(address,uint256)
Parameter Constraint spender
equal to TARGET_COMET
amount
-
If WETH
is TOKEN
:
WETH · deposit
Deposit ETH and receive WETH
tokens.
-
Contract:
WETH
-
Function:
deposit()
Ξ allow sending ETHParameter Constraint N/A N/A
WETH · withdraw
Unwrap WETH
and receive ETH tokens.
-
Contract:
WETH
-
Function:
withdraw(uint256)
Parameter Constraint wad
-
TARGET_COMET · supply
Deposit TOKEN
tokens into the corresponding TARGET_COMET
.
-
Contract:
TARGET_COMET
-
Function:
supply(address,uint256)
Parameter Constraint asset
equal to TOKEN
amount
-
TARGET_COMET · withdraw
Withdraw TOKEN
tokens from the corresponding TARGET_COMET
.
-
Contract:
TARGET_COMET
-
Function:
withdraw(address,uint256)
Parameter Constraint asset
equal to TOKEN
amount
-
Action: borrow
Parameters
Name | Type | Description |
---|---|---|
targets | string[] (required) | Token symbols | Token addresses |
TARGET_COMET
below refers to the address of the Comet
. It is automatically
determined based on the base token provided in each element of targets
.
TARGET_TOKEN
refers to the ERC-20 address of each token in targets
.
targets
must be a subset of the base tokens of the available Comets. For
example, for cUSDCv3
the base token is USDC
.
TARGET_TOKEN · approve
Approve TARGET_COMET
to spend TARGET_TOKEN
tokens on behalf of the avatar.
-
Contract:
TARGET_TOKEN
-
Function:
approve(address,uint256)
Parameter Constraint spender
equal to TARGET_COMET
amount
-
If WETH
is TARGET_TOKEN
:
WETH · deposit
Deposit ETH and receive WETH
tokens.
-
Contract:
WETH
-
Function:
deposit()
Ξ allow sending ETHParameter Constraint N/A N/A
WETH · withdraw
Unwrap WETH
and receive ETH tokens.
-
Contract:
WETH
-
Function:
withdraw(uint256)
Parameter Constraint wad
-
TARGET_COMET · supply
Deposit TARGET_TOKEN
tokens into the corresponding TARGET_COMET
.
-
Contract:
TARGET_COMET
-
Function:
supply(address,uint256)
Parameter Constraint asset
equal to TARGET_TOKEN
amount
-
TARGET_COMET · withdraw
Withdraw TARGET_TOKEN
tokens from the corresponding TARGET_COMET
.
-
Contract:
TARGET_COMET
-
Function:
withdraw(address,uint256)
Parameter Constraint asset
equal to TARGET_TOKEN
amount
-