Engineering at Brex, Apple, Microsoft. I write about fintech, crypto and China
On June 26, 2020, the value locked into the Compound protocol reached a staggering $1 billion, making it the "most valuable" decentralized finance protocol. In the past year, DeFi became the hottest topic in the crypto. Let's take a close look at one of its most popular projects.
This post is an "executive summary" about Compound a synthesis based on core resources such as the whitepaper and developer documentation.
It is common for cryptocurrency holders to purchase tokens and let them sit idle in accounts. In the past year, the majority of all Ethereum tokens have not moved. Perhaps an "unconscious" tendency carried over from traditional markets, some cryptocurrency holders let assets sit with the hope that their value will somehow increase over time.
For fiat currencies, interest rates have served as the "price" of money. It adjusts based on supply and demand and connects those who want to borrow with those who can lend. That has not been the case for crypto assets. There is still a possibility that tokens will depreciate, unlike some "real-world" assets such as real estate and dividends on equities.
Compound is about putting idle crypto assets to work. It is an open-source Ethereum protocol with interest rate markets, allowing users to supply and borrow Ethereum tokens. Through variable interest rates, Compound establishes money markets in which anyone can earn interest instantly by supplying assets, and borrow instantly at a given interest rate. These interest rates are algorithmically set and tracked by smart contracts, with no humans in the loop.
While lending/borrowing for cryptocurrencies was still possible before Compound, it was less efficient. In particular, there was a lack of liquidity as exchanges had to perform "matching" between borrowers and suppliers.
The key characteristics of the dynamic money markets run by Compound are:
The supply and borrowing interest rates represent an asset's Annual Percentage Yield (APY).
When you supply an asset such as DAI, Ethereum, Tether, USD Coin, or Basic Attention Token to the Compound protocol, you get cTokens in exchange. cTokens are simply ERC20 tokens that represent your balance in the Compound protocol. The main aspects of cTokens are:
Compound operates in markets, meaning that every asset has its own supply and demand market.
Interest rates are accrued with every Ethereum block. Every 15 seconds, the balance of cTokens increases by 1/2,102,400 of the quoted annual interest rate for the underlying asset.
Let's run through an example of how you might earn interest if you supply some DAI:
After supplying DAI to Compound, you get cTokens to represent the DAI. These cTokens are called cDAI. Every token has an exchange rate against its respective cToken, meaning that 1 DAI can be exchanged for a specific amount of cDAI.
The DAI market has an interest rate model. The moment you get access to cTokens, you start earning interest: As time goes by, each cToken becomes convertible to a growing amount of its underlying asset.
Interest is accrued for all suppliers and borrowers that interact with a market's cToken contract. When any of the following actions are triggered, interest is added to the underlying balance of every supplier and borrower:
Each cToken has a supply rate and borrow rate, which gets updated with every Ethereum block. We will dive into the specifics of supply and borrow rates soon.
Each market also has excess liquidity: there are always more assets supplied than assets borrowed. Interest paid by borrowers is earned by suppliers of the asset.
A small portion of the interest paid by borrowers is set aside as reserves (5 - 10% of the market).
As we saw earlier, in exchange for supplying an asset, the user gets some cTokens:
amount of cTokens = underlying tokens supplied / current exchange rate
The exchange rate between cTokens and the underlying asset increases over time. It is calculated by factoring in the total borrows and reserves of that asset:
exchangeRate = (underlyingBalance + totalBorrowBalance - reserves) / tokenSupply
As for the supply rate, also known as the APY earned by the supplier: It is derived from the following factors:
To borrow on Compound, users first supply assets to be used as collateral. For example, you can use DAI as collateral to borrow ETH, ZRX, BAT, and more.
The amount that you can borrow is a function of the collateral you supplied. Ranging from 0 to 1, the collateral factor represents the portion of the underlying asset value that can be borrowed.
For example, if you supplied $100 worth of ETH, which has a collateral factor of 75%, you can borrow at most $75.
Borrowing has no time duration, and balances can be repaid at any time. But interest is always accumulating, so if your borrowing balance exceeds the limit, your account can be liquidated. This can also happen if the collateral declines in value while the value of borrowed assets increases over time.
Liquidation is a reward/incentive mechanism in which a member of the Compound community can repay up to 50% of the asset you owe. In exchange, they receive a proportionate amount of your collateral but at a discounted price.
Let's walk through some examples of how Compound can be used for trading crypto assets:
It's possible to use borrowing to multiply exposure to a specific asset, or to short an asset.
“The individuals, applications and institutions that use the Compound protocol are capable of collectively stewarding it into the future — and are incentivized to provide good governance.” — Robert Leshner, Compound Founder
A guiding philosophy behind Compound is that the power should be in the hands of its community. To that end, the protocol has an on-chain system that distributes COMP (governance) tokens to Compound users. The goal is to allow COMP token holders and their representatives to propose and vote on actions that affect the protocol.
Just like cTokens, COMP tokens are ERC-20 assets. Every day, about 2,880 COMP tokens are distributed across all markets to the users of the protocol (equivalent to about USD 840k).
The number 2,880 comes from the fact that 4,229,949 COMP is placed in a reservoir contract, with approximately 0.44 COMP being distributed per Ethereum block--which totals about 2,880 per day.
50% of COMP goes to suppliers and the other half to borrowers.
Any address with more than 100,000 COMP can propose governance actions. Proposals can be found here: https://compound.comradery.io/
When a proposal is created, the community gets a 3-day voting period.
COMP was first tested with a limited group of stakeholders. Without relying on the Compound team or other middlemen, the community was able to vote on proposals such as adding a new asset, Tether, to the protocol and creating a new DAI interest rate model.
USD locked in Compound (notice what happened when the COMP token launched)! Source: https://cipher.substack.com/p/contextualising-compound
June 16 marked an important day for Compound, as the team announced the official launch of the COMP governance token. This is a milestone in the protocol's progress towards full decentralization, gradually waiving the central role of the Compound core team.
Since you get COMP by just interacting with the protocol (even when you borrow), it is possible to move large amounts of money to the markets just to receive some COMP to then sell them for profit.
Some deep-pocketed investors parked their idle tokens on Compound for a few days to receive a substantial amount of COMP, since the more you supply, the more COMP you get. These investors could then sell COMP in exchanges as their prices rose.
On June 25, Coinbase announced support for Compound (COMP).
We have yet to see what else might come out of the COMP rally, as well as what the core team will take on next. What we do know is that the explosive trajectory of projects like Compound has evidenced the unstoppable nature of DeFi.
Create your free account to unlock your custom reading experience.