An Introduction to DeFi Lending with Compound

·

The world of decentralized finance, or DeFi, has revolutionized how we think about borrowing, lending, and earning interest on digital assets. At the heart of this movement are lending protocols that allow users to supply and borrow cryptocurrencies without intermediaries. One of the foundational projects in this space is Compound.

The Evolution of DeFi Lending

DeFi lending didn't start with Compound. The earliest widely adopted DeFi application was actually MakerDAO's Maker Protocol, commonly known as the Multi-Collateral DAI (MCD) system. Established in 2014, MakerDAO aimed to create a stable cryptocurrency. The protocol generates DAI through smart contracts, pegging it 1:1 with the US dollar through an innovative system of collateralized debt positions, autonomous feedback mechanisms, and external incentives.

The key innovation was overcollateralization: asset holders could lock up more value than they borrowed, mint DAI through the Maker protocol, and then use that DAI for payments, services, or as savings.

Compound emerged later but quickly gained prominence. By July and August 2020, Compound had briefly surpassed MakerDAO to become the largest lending protocol in decentralized finance. This surge in popularity was largely driven by its innovative liquidity mining program, which rewarded both lenders and borrowers with COMP tokens.

However, the protocol faced challenges. In November 2020, Compound experienced a significant exploit where approximately $103 million in crypto assets were forcibly liquidated. The incident highlighted the risks of oracle dependence—Compound's DAI price came from a single exchange (Coinbase Pro), and attackers manipulated this price.

Launched in 2018, Compound introduced its V2 version in mid-2019, adding the cToken mechanism. The protocol now supports borrowing and lending for over a dozen tokens including ETH, USDC, and WBTC.

How Compound Lending Works

Supplying Assets

When users supply tokens to the Compound protocol, they earn interest on their deposits. For example, when you deposit USDC, you receive cUSDC tokens in return. These cTokens represent your share of the lending pool and effectively function as debt instruments that the protocol owes you.

The amount of cTokens you receive is theoretically 1:1 with your deposit, but their value increases over time as interest accrues. When you redeem your cTokens, you receive your original principal plus accumulated interest, calculated based on your proportion of the total cToken supply.

Borrowing Assets

To borrow from Compound, users must first supply assets as collateral. The protocol requires overcollateralization, meaning you must deposit more value than you borrow. This protects the system from price volatility.

Through oracle price feeds, the protocol continuously monitors the value of collateral assets. If a user's collateral value falls below the required threshold, their position may be liquidated—their collateral is sold at a slight discount to market price to repay the borrowed amount.

Key Concepts and Calculations

Utilization Rate = Total Borrows / (Cash + Total Borrows)

This metric measures what percentage of supplied assets are currently being borrowed.

Borrow Interest Rate = 2.5% + (Utilization Rate × 20%)

Supply Interest Rate = Borrow Interest Rate × Utilization Rate × (1 - Spread)

The spread (represented as S) ensures protocol sustainability. The interest earned by lenders must be less than that paid by borrowers to create a buffer for economic shocks.

The exchange rate between cTokens and underlying assets constantly increases. For example, if cETH has an exchange rate of 0.02, 1 cETH would redeem for 0.02 ETH. This increasing exchange rate represents the interest accumulation. The formula is: exchangeRate = (totalCash + totalBorrows - totalReserves) / totalSupply

Normally, interest rates respond to market conditions. When utilization reaches high levels (such as 80%), both deposit and borrowing rates increase sharply. This encourages more supplying to balance the pool and prevent depletion.

Security Considerations and Attacks

Like all DeFi protocols, Compound faces security challenges:

These vulnerabilities highlight the importance of thorough auditing and security practices in DeFi development.

The COMP Token Ecosystem

Compound's native token, COMP, serves dual purposes: ecosystem incentives and community governance. With a total supply of 10 million tokens, COMP was distributed without an initial coin offering (ICO).

Approximately 50% was allocated to investors, founders, and current and future team members. Of the remaining 50%, about 800,000 tokens were designated for community programs, while 4.2 million tokens were scheduled for distribution to protocol users over four years (with a daily distribution of 2,880 tokens).

Compound boasts impressive backing from prominent blockchain investment firms including a16z Crypto, Polychain Capital, Paradigm, and Coinbase Ventures. Despite this strong support, the token's performance has been mixed, declining over 80% from its all-time high to its all-time low.

Comparing Compound with Aave

Aave, originally called ETHLend, began in 2017 as a peer-to-peer lending platform before transitioning to a liquidity pool model and rebranding.

While Aave's core lending functions resemble Compound's, it offers several distinctive features:

Aave's V2 introduction brought significant upgrades:

  1. Collateral swaps via flash loans for quick collateral changes
  2. Batch flash loans allowing borrowing multiple tokens simultaneously
  3. Debt tokenization enabling uncollateralized borrowing

The debt tokenization feature creates tokens representing debt obligations when users borrow. These tokens exist in the borrower's wallet but cannot be transferred—they're only destroyed upon repayment. This innovation opens possibilities for Aave to extend credit to institutions, exchanges, and other DeFi protocols.

Key Innovations from Aave

Flash Loans: These innovative products leverage blockchain的特性—you can borrow funds without collateral provided you repay within the same blockchain transaction. If repayment doesn't occur, the entire transaction reverses as if the loan never happened.

Flash loans enable developers to capture instantaneous on-chain opportunities including arbitrage, front-running, and protocol mechanism exploitation.

Rate Flexibility: Users can choose between stable and variable interest rates for any borrowing transaction.

Aave has expanded beyond Ethereum to Polygon and Avalanche networks, with plans to launch on additional ecosystems like Cosmos' EVMOS.

👉 Explore advanced lending strategies

Frequently Asked Questions

What is the main difference between supplying and borrowing on Compound?
Supplying involves depositing assets to earn interest, while borrowing requires collateral to access loans. Suppliers receive cTokens representing their share of the pool, while borrowers pay interest on taken loans.

How does Compound determine interest rates?
Rates are algorithmically determined based on pool utilization. The borrowing rate equals 2.5% plus utilization multiplied by 20%. Supply rates derive from borrowing rates minus a protocol spread.

What happens if my collateral value drops too much?
If your collateral value falls below the required threshold, your position may be liquidated. The protocol will automatically sell your collateral at a slight market discount to repay your loan.

Can I lose money by supplying assets to Compound?
While supplying generally earns interest, technical risks exist including smart contract vulnerabilities, oracle manipulation, or protocol insolvency during extreme market conditions.

What makes cTokens valuable?
cTokens accumulate value through increasing exchange rates. As interest accrues in the protocol, each cToken becomes redeemable for more of the underlying asset over time.

How does Compound compare to traditional lending?
Compound offers permissionless, global access to lending services without credit checks or intermediaries. However, it requires overcollateralization and carries different risk profiles than traditional finance.

Conclusion: The Future of DeFi Lending

The DeFi lending landscape continues to evolve with different protocols finding their niches:

  1. MakerDAO maintains its fundamental role supporting the DAI stable币 with a robust foundation
  2. Compound pioneered liquidity mining but faces questions about its long-term token economics
  3. Aave offers sophisticated features and flexible rates but must balance innovation with security

Ultimately, both AMMs and lending protocols seek to solve the same fundamental problem: capital flow optimization and efficiency improvements. From Uniswap V3's concentrated liquidity to Compound's utilization rates and the Curve wars, the sector continues experimenting with models that maximize capital efficiency.

The current collaborations between protocols like Aave and Curve represent just the beginning of this evolution. As the space matures, we can expect even more innovative models to emerge that further push the boundaries of what's possible in decentralized finance.

The essence of lending remains allowing users to access more capital than they currently possess. The question for next-generation protocols is whether they can solve this fundamental need while maintaining security and accessibility for all participants.