DeFi Yield Farming
Earn yield by providing liquidity or lending. APR converts to APY with compounding. Factor in gas costs and impermanent loss for volatile pairs.
Why This Matters in Web3
Why: Yield farming can generate 5โ200%+ APY but comes with IL risk and gas costs. Understanding net profit after gas and IL is critical.
How: Enter principal, APR, compounding frequency, duration, gas per compound, and token price change for IL estimate. Calculator outputs APY, total yield, gas cost, and net profit.
- โAPY > APR with compounding
- โIL can erase yield
- โL2 reduces gas drag
๐ Quick Examples โ Click to Load
๐ Yield Breakdown
๐ฅง Portfolio Composition
๐ APY & Yield
๐ Value Over Time
For educational and informational purposes only. Verify with a qualified professional.
โฟ Blockchain Facts
Uniswap V3 allows concentrated liquidity for higher capital efficiency and APR.
IL is impermanentโif prices return to original ratio, IL reverses.
APR is the stated rate before compounding. APY = (1 + APR/n)^n - 1. Daily compounding at 20% APR yields ~22.1% APY. Impermanent loss occurs when providing liquidity to AMMsโif price ratio changes, you may have less value than holding. IL = 2โ(k)/(1+k) - 1. Gas costs reduce net yield on mainnet; use L2 for frequent compounding.
Sources: Uniswap, Aave, Compound docs.
Key Takeaways
- โข APY > APR due to compounding. Daily compounding maximizes yield.
- โข Impermanent loss can erase yield gains when token prices diverge.
- โข Gas costs matterโon mainnet, compound less often or use L2.
- โข Stablecoin pairs: lower IL, lower APR. Volatile pairs: higher APR, higher IL risk.
Did You Know?
How Does Yield Farming Work?
APR to APY
APY = (1 + APR/n)^n - 1. n = compounds per year. Daily: n=365. Weekly: n=52. More compounds = higher APY.
Impermanent Loss
IL = 2โ(priceRatio)/(1+priceRatio) - 1. When one token doubles vs the other, IL โ -5.7%. When 10x, IL โ -25%.
Gas Impact
Each harvest+reinvest costs gas. On mainnet $20โ50/tx, compounding daily can cost $7K+/year. Use L2.
Expert Tips
Yield Strategy Comparison
| Strategy | APR | IL Risk |
|---|---|---|
| Stablecoin pair | 5โ15% | Low |
| ETH pair | 20โ50% | Medium |
| Volatile pair | 50โ200%+ | High |
Frequently Asked Questions
What is APR vs APY in DeFi?
APR (Annual Percentage Rate) is the stated rate before compounding. APY (Annual Percentage Yield) accounts for compounding frequency. Formula: APY = (1 + APR/n)^n - 1, where n is compounds per year. Daily compounding at 20% APR yields ~22.1% APY.
What is impermanent loss?
When providing liquidity to an AMM (e.g., Uniswap), if the price ratio of the two assets changes, you may have less value than simply holding. IL = 2โ(k)/(1+k) - 1 where k is the price ratio. IL is "impermanent" because it can reverse if prices return.
How does compounding affect yield?
More frequent compounding increases effective yield. Daily compounding at 20% APR gives ~22.1% APY; monthly gives ~21.9%. On L2, compound frequently to maximize yield while gas costs are low.
What are stablecoin pools?
Stablecoin pairs (e.g., USDC/USDT) have lower impermanent loss but typically lower APR (5โ15%). Volatile pairs (e.g., ETH/USDC) have higher APR (20โ100%+) but significant IL risk when prices move.
How do gas costs affect yield farming?
Each compound (harvest + reinvest) costs gas. On Ethereum mainnet, frequent compounding can eat 10โ50% of yield. Use L2 (Arbitrum, Base) where gas is cheap, or compound less frequently.
Is yield farming risky?
Yes. Risks include smart contract bugs, impermanent loss, token price collapse, and rug pulls. Only invest what you can afford to lose. Stick to audited protocols (Uniswap, Aave, Compound).
Key Statistics
Official Data Sources
โ ๏ธ Disclaimer: This calculator is for educational purposes only. DeFi involves smart contract and IL risk. Not financial advice. Only invest what you can afford to lose.
Related Calculators
Crypto DCA Simulator Calculator
Simulate dollar-cost averaging into crypto. Total invested, total value, average cost basis, ROI, DCA vs lump sum comparison.
Crypto & BlockchainCrypto Portfolio Rebalancer
Calculate rebalancing trades for crypto portfolio. Current vs target allocation, buy/sell amounts, before/after pie charts, cost estimate. Threshold vs...
Crypto & BlockchainBlockchain Gas Fee Calculator
Estimate Ethereum transaction fees in ETH and USD. Compare L1 vs L2 (Arbitrum, Optimism, Base, Polygon). EIP-1559 gas mechanics.
Crypto & BlockchainMining Profitability Calculator
Calculate mining revenue, electricity costs, net profit, break-even days, and ROI for Bitcoin, Ethereum, Litecoin.
Crypto & BlockchainNFT Royalty & Marketplace Fee Calculator
Calculate creator earnings, platform fees, and buyer costs for NFT sales. Compare OpenSea, Blur, LooksRare, Magic Eden. Includes ERC-2981 royalty info and...
Crypto & BlockchainEffective Interest Rate Calculator
Calculate the true annual interest rate that accounts for the effects of compounding.
Finance