Operating the Compound Protocol Manually

Geoff Hayes
Compound Labs
Published in
3 min readFeb 9, 2018

--

In the event that MetaMask or the Compound Interface are malfunctioning, you can always access the Compound protocol manually. This guide contains instructions for interacting with the Compound protocol using MyEtherWallet, and is intended for users familiar with Ethereum smart contracts.

Contracts, ABI, and Interface

Smart contract addresses, contract ABIs, and function descriptions for the protocol are available at compound.finance/docs.

1. Supplying Tokens

There are only two transactions required to supply a token to the protocol, to begin earning interest.

Approve the use of your token

First, we have to approve the Compound cToken contract to use the token in our wallet. Visit https://www.myetherwallet.com/#contracts and:

  • Enter the Contract Address of the token you’d like to supply (e.g. DAI)
  • Copy and paste the ERC-20 ABI
  • Click Continue, then under Select an item, select the approve function
  • Paste the cToken address (e.g. 0x5d3a536e4d6dbd6114cc1ead35777bab948e3643 for cDAI) in _spender
  • Enter your quantity of tokens in _value (add 18 zeros)
  • Do not modify the Value in ETH, and click Write

Supply Tokens to Compound

Next, we supply the token to Compound. Visit https://www.myetherwallet.com/#contracts and:

  • Enter the Contract Address of the associated cToken contract, e.g. 0x5d3a536e4d6dbd6114cc1ead35777bab948e3643 for cDAI
  • Copy and paste the cToken ABI
  • Click Continue, then under Select an item, select the mint function
  • Enter your quantity of tokens in MintAmount (add 18 zeros)
  • Do not modify the Value in ETH, and click Write

2. Withdrawing Tokens

After earning interest, you might want to withdraw your assets supplied to the protocol, back to your wallet. Visit https://www.myetherwallet.com/#contracts and:

  • Enter the Contract Address of the associated cToken contract, e.g. 0x5d3a536e4d6dbd6114cc1ead35777bab948e3643 for cDAI
  • Copy and paste the cToken ABI
  • Click Continue, then under Select an item, select the redeemUnderlying function
  • Enter your quantity of tokens in RedeemAmount (add 18 zeros)
  • Do not modify the Value in ETH, and click Write

3. Borrowing Tokens

You’re able to borrow any supported token, based on the collateral you’ve supplied to Compound.

Enable a supplied asset as collateral

First, we have to approve the Compound cToken contract to use the token in our wallet. Visit https://www.myetherwallet.com/#contracts and:

  • Enter the Contract Address of the Comptroller, 0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b
  • Copy and paste the Comptroller ABI
  • Click Continue, then under Select an item, select the enterMarketfunction
  • Paste the cToken address (e.g. 0x5d3a536e4d6dbd6114cc1ead35777bab948e3643 for cDAI) in _address
  • Do not modify the Value in ETH, and click Write

Borrow an Asset

You’re able to borrow any supported token, based on the collateral you’ve supplied to Compound. Visit https://www.myetherwallet.com/#contracts and:

  • Enter the Contract Address of the associated cToken contract, e.g. 0xc11b1268c1a384e55c48c2391d8d480264a3a7f4 for WBTC
  • Copy and paste the cToken ABI
  • Click Continue, then under Select an item, select the borrow function
  • Enter your quantity of tokens in BorrowAmount (add 18 zeros)
  • Do not modify the Value in ETH, and click Write

4. Repaying Tokens

Note: you must first approve the asset to be used by Compound.

At any time, you can close your borrowed position (to unlock your collateral). Visit https://www.myetherwallet.com/#contracts and:

  • Enter the Contract Address of the associated cToken contract, e.g. 0xc11b1268c1a384e55c48c2391d8d480264a3a7f4 for WBTC
  • Copy and paste the cToken ABI
  • Click Continue, then under Select an item, select the repayBorrow function
  • Enter your quantity of tokens in RepayAmount (add 18 zeros)
  • Do not modify the Value in ETH, and click Write

5. Claiming COMP

To manually claim COMP:

  1. Visit Etherscan, press the Connect to Web3 button, and link a MetaMask account.
  2. Scroll to function 21. claimComp, input your (or any other address), and then Write and submit the transaction.

Troubleshooting

If you ever have trouble operating the protocol, join our Discord and say hello!

--

--