Learn
Compound v2

Compound v2

https://compound.finance (opens in a new tab)

Deployments

NameAddress
Comptroller0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B (opens in a new tab)
Maximillion0xf859A1AD94BcF445A406B892eF0d3082f4174088 (opens in a new tab)
cETH0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5 (opens in a new tab)

Action: deposit

Parameters

NameTypeDescription
targetsstring[] (required)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 cToken to spend TARGET tokens on behalf of the avatar.

  • Contract: TARGET

  • Function: approve(address,uint256)

    ParameterConstraint
    spenderequal to cToken
    amount-

cToken · mint

Deposit TARGET tokens and receive cToken tokens in exchange.

  • Contract: cToken

  • Function: mint(uint256)

    ParameterConstraint
    amount-

Comptroller · enterMarkets

Set deposited asset as collateral.

  • Contract: Comptroller

  • Function: enterMarkets(address[])

    ParameterConstraint
    cToken[]equal to [cToken]

Comptroller · exitMarket

Unset deposited asset as collateral.

  • Contract: Comptroller

  • Function: exitMarket(address)

    ParameterConstraint
    cTokenequal to cToken

cToken · redeem

Redeem cToken and withdraw TARGET (it is called when MAX underlying amount is withdrawn).

  • Contract: cToken

  • Function: redeem(uint256)

    ParameterConstraint
    amount-

cToken · redeemUnderlying

Redeem cToken and withdraw TARGET.

  • Contract: cToken

  • Function: redeemUnderlying(uint256)

    ParameterConstraint
    amount-

Comptroller · claimComp

Claim COMP rewards.

  • Contract: Comptroller

  • Function: claimComp(address,address[])

    ParameterConstraint
    holderequal to AVATAR
    cToken[]equal to [cToken]

Target: ETH

For "ETH" as an element of targets, the following functions are allowed:

cETH · mint

Deposit ETH and receive cETH tokens in exchange.

  • Contract: cETH

  • Function: mint() Ξ allow sending ETH

    ParameterConstraint
    N/AN/A

Comptroller · enterMarkets

Set deposited asset as collateral.

  • Contract: Comptroller

  • Function: enterMarkets(address[])

    ParameterConstraint
    cToken[]equal to [cETH]

Comptroller · exitMarket

Unset deposited asset as collateral.

  • Contract: Comptroller

  • Function: exitMarket(address)

    ParameterConstraint
    cTokenequal to cETH

cETH · redeem

Redeem cETH and withdraw ETH (it is called when MAX underlying amount is withdrawn).

  • Contract: cETH

  • Function: redeem(uint256)

    ParameterConstraint
    amount-

cETH · redeemUnderlying

Redeem cETH and withdraw ETH.

  • Contract: cETH

  • Function: redeemUnderlying(uint256)

    ParameterConstraint
    amount-

Comptroller · claimComp

Claim COMP rewards.

  • Contract: Comptroller

  • Function: claimComp(address,address[])

    ParameterConstraint
    holderequal to AVATAR
    cToken[]equal to [cETH]

Action: borrow

Parameters:

NameTypeDescription
targetsstring[] (required)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 cToken to spend TARGET tokens on behalf of the avatar.

  • Contract: TARGET

  • Function: approve(address,uint256)

    ParameterConstraint
    spenderequal to cToken
    amount-

cToken · borrow

Receive TARGET tokens.

  • Contract: cToken

  • Function: borrow(uint256)

    ParameterConstraint
    amount-

cToken · repayBorrow

Repay borrowed TARGET tokens.

  • Contract: cToken

  • Function: repayBorrow(uint256)

    ParameterConstraint
    amount-

Target: ETH

For "ETH" as an element of targets, the following functions are allowed:

cETH · borrow

Receive ETH.

  • Contract: cETH

  • Function: borrow(uint256)

    ParameterConstraint
    amount-

Maximillion · repayBehalf

Repay borrowed ETH.

  • Contract: Maximillion

  • Function: repayBehalf(address) Ξ allow sending ETH

    ParameterConstraint
    borrowerequal to AVATAR