Using Basic Math to Understand Mature DeFi Projects
Several mature DeFi projects have established themselves in the space, offering various services like lending, borrowing, trading, and staking. In this tutorial, we will apply basic math to assess the risk and potential return on these platforms.
1. Aave – Lending and Borrowing
Aave has a TVL of over $12 billion. Let’s calculate the potential interest earnings.
Interest Calculation
If you deposit $10,000 into Aave at a 5% interest rate, the formula is:
Interest = Principal × Rate
For a year:
Interest = 10,000 × 0.05 = 500
You earn $500 in interest by the end of the year.
Compounded Interest
If interest is compounded monthly, we use the formula:
A = P(1 + r/n)nt
Where:
- P = Principal ($10,000)
- r = Annual interest rate (0.05)
- n = Number of compounding periods (12)
- t = Time in years (1)
Plugging in the values:
A = 10,000(1 + 0.05/12)12 = 10,512
Your balance after one year is $10,512.
2. MakerDAO – Stablecoin Minting
In MakerDAO, if you lock $5,000 worth of ETH to mint 2,500 DAI, you must calculate the collateral ratio.
Collateral Ratio Calculation
MakerDAO requires a collateral ratio of 150%. To mint 2,500 DAI, the required collateral is:
Required Collateral = Minted DAI ÷ Collateralization Ratio
Required Collateral = 2,500 ÷ 1.5 = 3,750
You need to lock up $3,750 worth of ETH.
3. Uniswap – Liquidity Pools
Uniswap allows liquidity providers to add tokens into pools. Let’s calculate impermanent loss.
Impermanent Loss Calculation
If you deposit $5,000 each of ETH and USDC into a liquidity pool, and ETH price increases by 20%, the impermanent loss is:
Impermanent Loss = 1 - √((2 × P_old) ÷ (P_new + 1))
With ETH rising from $1,000 to $1,200, the impermanent loss is:
Impermanent Loss = 1 - √(2,000 ÷ 2,200) = 0.047 or 4.7%
This means you incur a loss of 4.7% (or $470).
4. Compound – Interest on Lending
Suppose you lend $1,000 USDC at an interest rate of 6%. The interest for a year is:
Interest = 1,000 × 0.06 = 60
You earn $60 in a year.
If the rate changes to 8% after 6 months, the calculation is:
- First 6 months at 6%:
Interest = 1,000 × (0.06 ÷ 2) = 30
- Next 6 months at 8%:
Interest = 1,000 × (0.08 ÷ 2) = 40
Total interest earned = $70.
5. Curve Finance – Stablecoin Swaps
Curve Finance specializes in low-fee stablecoin swaps. For example, if you trade $10,000 USDT for DAI, and Curve charges a 0.04% fee, the fee is:
Fee = 10,000 × 0.0004 = 4
You pay $4 in fees.
Conclusion
Basic math can help you assess risks, calculate returns, and make informed decisions when using DeFi platforms. Understanding interest rates, collateral ratios, impermanent loss, and fees enables you to evaluate potential returns and risks.