What is Compound and How Does it Work?

17.05.2021 | 7 min read

Compound logo

Compound (COMP) is the brainchild of Geoffrey Hayes and Robert Leshner who created the protocol back in 2016.

COMP is a decentralized blockchain protocol or more precisely a decentralized finance protocol (DeFi). It allows users to deposit and borrow cryptocurrencies, and allows them to earn interest on these. If you are really into the topic, the solution provided by Alchemix - where loans pay themselves - will be of much interest to you, but let's get back to COMP.

The COMP protocol is based on Ethereum and, in its most basic form, is a smart contract between non-Ethereum cryptocurrencies.

Compound started DeFi summer

Compound started the ‘DeFi summer’ back in May 2020 with its liquidity mining program of COMP tokens. Users who took part in this program were rewarded for lending and borrowing in the form of COMP tokens. This reward resulted in the dramatic increase of APYs of various tokens. Users were also incentivized to keep switching between lending and borrowing different tokens for a maximum yield. This resulted in the development of yield farming. And thus, the DeFi summer began.

After this program was launched several other protocols surfaced, which started distributing their tokens in the same manner, through liquidity mining. With this, even more opportunities for yield farming were created.

» We are 10Clouds: Introducing the DeFi Developer Roadmap

Tutorial on using Compound

There are two major ways of using and earning from COMP tokens - one is via borrowing and lending and the other is through COMP mining. Let’s take a look at both.

Borrowing and lending on the Compound platform

Users can earn COMP when they borrow or lend cryptocurrencies on the Compound platform. User can earn COMP even if they net interest in negative. This happens because borrowing and lending cryptocurrencies result in the users earning COMP tokens and with these taken they can earn, per anum, a higher percentage of APY of COMP. In short, with precise calculations, users are basically paid to take out loans.

Mining COMP

COMP mining can be simple and straightforward. By mining COMP, users can maximize their COMP reward in the shortest amount of time. There are added ways to increase the rewarded COMP even further but for now, they are outside the scope of this article.

Lending / Borrowing mechanism

In DeFi lending is based on smart contracts that run on open blockchains, in the case of COMP the blockchain is based on Ethereum. This lending mechanism is available to everyone since it does not require users to prove their identity.

Users wanting to become lenders supply their tokens to money markets created against particular tokens such as ETH or BTC. These users receive interest according to the supply APY of the token they have given to the money markets.

The token supplied to the money market by lenders then enter a smart contract and are available for other users to borrow. Against the borrowed tokens, the smart contract issues cTokens plus interest to the lender.

The borrower must also supply other tokens, more than the value of the amount they are borrowing, in the form of collateral. This collateral will be liquidated if the value of collateral multiplied by the collateral factor falls below the borrowed amount. The value of the collateral must always be greater than the borrowed amount.

How does Compound work

In its most basic form the working of Compound can be summed up in the following three points:

● Compound allows you to earn compound interest by supplying assets such as crypto to its liquidity pool.

● The compound interest rates automatically adjust depending on the supply and demand of your respective asset.

● The collateral can be withdrawn or paid at any time, there is no lockdown period.

In Compound the deposited amount goes to smart contracts and this ensures that the lenders are in control of their assets.

banner with text and laptops

Markets

As for the Compound markets right now as of May 2020 the top three markets for supply are ETH, DAI, USDC. The total number of markets is 12, which includes:

● Ether (ETH)

● Dai (DAI)

● USD Coin (USDC)

● Wrapped BTC (WBTC)

● Tether (USDT)

● Uniswap (UNI)

● Compound Governance Token (COMP)

● Wrapped BTC [Legacy] (WBTC)

● Ox (ZRX)

● Basic Attention Token (BAT)

● Sai [Deprecated] (SAI)

● Augur v1 [Deprecated] REP

The total number of suppliers is about to reach 300 Thousand with $19 Billion while the total number of borrowers is around 8 thousand with $8.5 Billion.

Governance

When it comes to the governance of Compound, it is being slowly decentralized and it is all thanks to the COMP tokens. These tokens entitle the users who hold these tokens to governance rights and fees over the protocol.

The token holders have the ability to make changes to the protocol via proposals and on-chain voting. When token holders vote on proposals, each vote represents one vote on the proposal.

The protocol is not fully decentralized yet but it is surely on its way to complete decentralization. For now, the most common proposals on which users vote are either on the cTokens markets to list, interest rates and collateralization, and blockchain oracles.

cTokens

cTokens are tokens supplied by Compound, they are the back-end unit of account of the protocol. These tokens are used to keep track of the cryptocurrencies supplied by lenders. The tokens also keep track of the interest that is earned.

cTokens are directly proportional to the stake lenders have in the lending pool. Lenders are supplied with these tokens when they supply funds to the lending pool. Each asset, such as a DAI or BTC, have their own cTokens. In the case of DAI the cToken would be cDAi and so on. The longer a user holds the cToken the more valuable it becomes due to the compound interest.

Since the cTokens are ERC20 tokens, they can be stored in Coinbase Wallet or Metamask and can also be scanned with Etherscan at any time. These tokens can also be exchanged outside of the Compound protocol with any other ERC20 protocol, but it is important to keep in mind that by doing so the users will also be exchanging their stakes in the lending pool.

banner with laptop

Security

When it comes to the security of the Compound protocol, it has been reviewed and Audited by 3 iterations from Trail of Bits and 6 iterations from OpenZeppelin. The Compound protocol was also verified by Certora with their Certora ASA which is now an integrated part of Compound’s CI system.

As for economic stability, Compound has been tested by Gauntlet which is a financial modeling platform for crypto. According to Gauntlet’s results, the Compound protocol scales its supported assets and volume.

Lastly, Compound has a bug bounty program with rewards ranging from $500 to $150,000 for eligible discoveries.

Risks

One important element which is worth considering with Compound is the risk of oversupply. Coinbase refers to this as ‘genetically modified yield farming.’

There are currently more DAI in supply on Compound than there are DAI in the world. Impossible? Maybe not. Liquidity on Compound is shifting dramatically between assets as new rules for distribution of its governance token, COMP, take effect.

So how has this happened? Well, Compound counts each DAI deposit as additional gross supply, even if that DAI was just borrowed. For example, if there were 150 DAI and a user deposited 300 USDC, they could then borrow all that DAI and deposit again. It’s worth noting that some users are likely running several wallets to make this work more easily.

Roadmap and further updates

Compound is currently in the process of issuing COMP to its user in order to achieve full-decentralization. It was announced in 2020 that the plan to fully decentralize Compound will take 4 years. After the successful completion of the plan, the governance of the protocol will be in the hands of Compound users.

Are you looking for expert advice about blockchain implementation at your company?

Get in touch with me for a free blockchain consultation. You can contact me on dennis.vandervecht@10clouds.com or call me on +48 793 200 141

You may also like these posts

Start a project with 10Clouds

Hire us
cookie