A Complete Guide to Compound's Interest Rate Model in DeFi

·

Compound is a decentralized lending and borrowing protocol built on the Ethereum blockchain. Unlike traditional finance, it offers transparent interest rate models, high privacy, instant loans, and no-lock-in savings.

How Compound Works: The Basic Structure

Let's use DAI, which often has one of the highest supply APYs, as an example. Lenders deposit DAI into a smart contract to immediately start earning interest. Borrowers can then take out loans in DAI by collateralizing other assets, such as ETH, and pay interest on the borrowed amount.

A few key points about this structure:

How Does Compound Enable Instant Deposits and Withdrawals?

The protocol uses a clever token system. When a lender deposits 1 DAI into the smart contract, they receive cDAI (compound DAI) tokens in return. The lender can later redeem these cDAI tokens for the original DAI plus any accrued interest.

How is Interest Generated?

The key to understanding interest accrual is the exchange rate between the underlying asset (e.g., DAI) and its cToken (e.g., cDAI).

If a lender deposits 1 DAI and receives 40 cDAI, the initial exchange rate is 1 DAI / 40 cDAI = 0.025. Over time, as interest accrues, this exchange rate increases.

By simply holding cTokens, a lender automatically earns interest on the underlying supplied asset.

A Practical Example

  1. On October 10, 2019, Alice deposits 1000 DAI and receives 40,000 cDAI. The exchange rate is 0.025.
  2. On October 10, 2020, Alice decides to withdraw her funds. The exchange rate has now increased to 0.0275.
  3. She redeems her 40,000 cDAI for 40,000 × 0.0275 = 1100 DAI.
  4. The extra 100 DAI is the interest she earned over the year.

How is the Exchange Rate Calculated?

The exchange rate for a cToken is determined by several variables:

The exchange rate increases as more borrowing activity occurs, driving up the totalBorrows and the interest that needs to be distributed.

Borrow APR and Supply APY

A central concept in Compound's model is the Utilization Rate (U).

Simply put, the utilization rate is the percentage of the total supplied assets that are currently being borrowed.

For example, if the utilization rate for DAI is 62.13%, it means that 62.13% of all deposited DAI is currently out on loan.

This utilization rate is the primary input for Compound's core interest rate model.

Borrow APR

The borrow interest rate (APR) is calculated based on:

  1. Base Rate
  2. Utilization Rate (U)
  3. Multiplier
Borrow APR = Base Rate + (Utilization Rate × Multiplier)

For Compound's DAI market, the Base Rate is 5% and the Multiplier is 12%. If the current Utilization Rate is 62.13%:

Borrow APR = 5% + (12% × 0.6213) = 12.46%

This is the annualized rate a borrower would pay at that exact moment.

Supply APY

The supply interest rate (APY) that lenders earn is derived from the borrow rate. It is influenced by:

  1. Borrow APR (the rate calculated above)
  2. Utilization Rate (U)
  3. Reserve Factor
Supply APY ≈ Borrow APR × Utilization Rate × (1 - Reserve Factor)

Using the same DAI example, with a Borrow APR of 12.46%, a Utilization Rate of 62.13%, and a Reserve Factor of 5%:

Supply APY ≈ 12.46% × 62.13% × (1 - 5%) = 12.46% × 0.6213 × 0.95 = 7.35%

This is the annualized rate a lender would earn at that moment.

It's important to note that the Base Rate, Multiplier, and Reserve Factor are unique constants for each asset market on Compound. These parameters can be adjusted by the protocol's admin, and all changes are recorded transparently on the blockchain.

Key Takeaways from the Model

With fixed constants, the borrow and supply rates for a single asset have theoretical minimum and maximum values because the only variable is the Utilization Rate.

For DAI:

Actual rates will fluctuate between these extremes based on real-time market supply and demand (utilization).

How Often Do Rates Update?

Interest rates on Compound update in near real-time. The smallest unit of time for a rate change is one Ethereum block. With a new block mined approximately every 15 seconds, interest rates can potentially change that frequently.

Compound calculates interest per block by dividing the annual rate by the estimated number of blocks in a year, which the protocol sets at 2,102,400.

A Practical Example of Interest Accrual

  1. Bob borrows 100,000 DAI on October 10th at 11:00 AM. The borrow APR is 10%.
  2. At 12:00 PM, due to a change in the utilization rate, the borrow APR increases to 15%.
  3. Bob repays the full loan at 1:00 PM on the same day.

How much does Bob owe?

How Are Borrowers Forced to Repay? The Role of Collateral and Liquidation

To secure a loan, a borrower must collateralize assets. If the value of their collateral falls too close to the value of their loan, it can be liquidated.

Each asset on Compound has a Collateral Factor—a loan-to-value (LTV) ratio that determines how much can be borrowed against it.

Liquidation Example:

  1. Carol collateralizes 3 ETH (worth $600 at $200/ETH) to borrow DAI.
  2. ETH's collateral factor is 75%, so her borrowing power is $600 × 0.75 = **$450**.
  3. She borrows 445 DAI (assuming 1 DAI = $1).
  4. Later, she owes 451 DAI (principal + 6 DAI interest), but hasn't repaid. Her debt ($451) now exceeds her borrowing power ($450).
  5. A portion of her collateral is now eligible for liquidation. A liquidator can repay up to half of her outstanding debt (451 / 2 = ~225.5 DAI).
  6. In return for repaying 200 DAI of her debt, the liquidator can seize Carol's collateral at a discount. With a liquidation incentive of, for example, 10%, the liquidator receives $220 worth of ETH (1.1 ETH) for repaying 200 DAI.
  7. After this liquidation, Carol's debt is reduced by 200 DAI to 251 DAI. She now has 1.9 ETH left as collateral, valued at $380. Her new borrowing power is $380 × 0.75 = $285, which is greater than her remaining $251 debt, so the liquidation process stops.

This mechanism protects lenders by ensuring loans are always over-collateralized. 👉 Explore more DeFi strategies

Frequently Asked Questions

How does Compound make money?
Compound doesn't "make money" in a traditional sense. The protocol collects a portion of the interest paid by borrowers (the Reserve Factor) and holds it in a reserve, which acts as an insurance fund to cover potential shortfalls and secure the system.

Is lending on Compound safe?
While innovative, DeFi protocols carry risks. The primary risk on Compound is smart contract vulnerability. The protocol has undergone extensive audits, but the code is complex. There is also the risk of a collateral asset crashing in value faster than liquidators can act, potentially leaving some loans under-collateralized.

Can I lose money by supplying assets?
The main risk for suppliers is smart contract risk. Your deposited funds are not FDIC insured. However, the liquidation mechanism for borrowers is designed to protect suppliers from losses due to borrower default. You earn interest continuously for as long as your assets are supplied.

What is the difference between APR and APY on Compound?
For borrowers, the rate is shown as an APR (Annual Percentage Rate). For suppliers, the rate is shown as an APY (Annual Percentage Yield), which takes into effect the compounding nature of interest, which accrues every block (approximately every 15 seconds).

Who sets the interest rates on Compound?
Ultimately, the market does. Rates are determined algorithmically based on the supply and demand (utilization) for each asset. The protocol's governance can adjust the model parameters (Base Rate, Multiplier, Reserve Factor) for each market to influence how rates respond to utilization.

What happens if Compound's admin changes the parameters?
The protocol is designed to be governed by its token holders (COMP). Any proposed changes to interest rate model parameters must be voted on by the community, making the process decentralized and transparent.

Conclusion

Compound's interest rate model is a cornerstone of DeFi, enabling efficient and transparent capital markets.