The Compound protocol is an unprecedented technological advancement in the history of finance: for the first time in history, one can borrow money and earn interest with no humans, governments, or credit involved.
Rates vary frequently, though, and it is important to understand how the protocol determines interest rates.
All interest rates in Compound are determined as a function of a metric known as the utilization rate. The utilization rate for a money market is defined1 as:
Intuitively speaking, this is the percentage of money borrowed out of the total money supplied.
For example: given that reserves are 0, if Alice supplies $500 USDC and Bob supplies $500 USDC, but Charles borrows $100 USDC, the total borrows is $100 and the total cash is , so the utilization rate is .
A high ratio signifies that a lot of borrowing is taking place, so interest rates go up to get more people to inject cash into the system. A low ratio signifies that demand for borrowing is low, so interest rates go down to encourage more people to borrow cash from the system. This follows economic theory's idea of price (the "price" of money is its interest rate) relative to supply and demand.
Borrow and supply rates are calculated using the utilization rate and several arbitrary constants.
The supply rate is calculated as follows:
where
The borrowing rate's calculation depends on something called an interest rate model -- the algorithmic model to determine a money market's borrow and supply rates. In this post, I'll go over the interest rate model used for USDC and most other coins: the Compound Standard Interest Rate Model.
This interest rate model takes in two parameters:
The graph is linear:
Let's say the protocol has 10,000 WBTC supplied to it and users are borrowing 1,000 WBTC. The utilization rate is thus 10%. What should the rates be?
The cWBTC market uses a model where the base rate is 2% and the multiplier is 30%. To calculate our borrow interest rate:
Next, let's assume the reserve factor of the WBTC market is 20%. We can now calculate the supply interest rate:
For a sanity check, let's make sure that there is a net positive cash flow; that is, the protocol is not losing money:
You can view the effect of utilization rate on the supply using this interactive graph on the Compound WBTC market's summary page. Note that the numbers are slightly different due to the graph on the website including COMP rewards APY.
Here is the underlying smart contract of the rate model.
Let's say that with the previous example, a whale decided to withdraw an additional 8,000 WBTC from the protocol. What happens to rates?
The new utilization factor is , up 9x from 10%.
An interesting thing to note here is that the supply interest rate increased dramatically (up 5120%), but the borrow rate only increased by 480%. This is because the supply interest rate is proportional to the square of the utilization rate, whereas the borrow interest rate is only linearly proportional to the utilization rate.
Some markets follow what is known as the "Jump Rate" model. This model has the standard parameters:
but it also introduces two new parameters:
The borrow rate of the jump rate model is defined as follows:
The USDC rate model is a jump rate model with the following parameters:
The USDC market also has a reserve factor of 7%.
Let's say that the market has the following status:
What is the borrow rate and supply rate?
Doing the math:
In Compound, interest rate is not locked at the price of borrowing: it continuously fluctuates based on changes in the utilization rate.
Another way interest rates could spike is if the Chief Economist decides that the interest rates should go up. This has already happened in the case of MakerDAO, where the stability fee has ranged between 0% and 8%. Fortunately, both Compound and MakerDAO have transparent processes when changing interest rates with beautiful governance dashboards and decisions voted on by governance token holders.
This is in stark contrast to the current quarterly speculation on the Fed/FOMC's decisions. Compound's decision making process on the other hand is transparent and decentralized, protecting the interests of financiers (pun intended).3
One can compute the total interest they will pay on a principal balance for a duration in days with the following equation:
where
The number 2,102,400 assumes 15 second blocks.4
Since your interest rate isn't locked in at the time of borrowing, you are be vulnerable to interest rate changes. It is important to understand how the interest rate model of your selected currency works to ensure that there are no surprise massive interest rate changes.
There are several protocols attempting to build interest rate swaps for Compound, e.g. swaprate.finance and Opium Protocol. Interest rate swaps are essentially a way to lock in a borrowing interest rate (usually higher than spot) for a fixed period of time. This is useful if you want to remove more variables from a trading strategy.
Aave, another pool-based lending protocol, has implemented pseudo-fixed rate swaps using an oracle to determine a likely upper bound for what average interest rates could look like over the term of the loan. This has its own problems though and an independent swap market is likely the best solution to this problem.
Compound is a very powerful building block of the Ethereum DeFi ecosystem. Understanding the ways rates change is important in evaluating the potential performance of any leveraged position.
If you enjoyed this post and/or would like to hear more, please leave a comment below!
Source: Compound whitepaper ↩
According to proposal 31, the Reserve Factor is a percentage of the borrowers paid interest which can be used by the governance or act as an insurance against borrower default which protects all the suppliers. ↩
Technically, this system is not immune to insider trading. A member of governance can trade before voting. Also since COMP can be borrowed on Compound, one can stake a lot of ETH, borrow COMP, place a large vote, then repay all of the COMP. ↩
At the time of writing Ethereum has been producing ~13 second blocks, so all annualized rates in Compound should be multiplied by approximately 15/13. Although this number is hardcoded into the smart contract, the rate model may be updated in the future via governance. ↩
Thanks for reading! Have any questions, comments, or suggestions? Feel free to use the comment section below or email me at [email protected] and I'll do my best to respond.
Alternatively, you can view the source of the post here and send a pull request.