Finance & Economics · Portfolio Management
Yield Farming APY Calculator
Calculates the Annual Percentage Yield (APY) from yield farming, accounting for compounding frequency and reward reinvestment.
Calculator
Formula
APY is the Annual Percentage Yield after compounding. r is the nominal APR (as a decimal), n is the number of compounding periods per year (e.g., 365 for daily, 52 for weekly, 12 for monthly). The formula converts a flat APR into the effective annualised return when rewards are reinvested at each compounding interval.
Source: Standard compound interest formula; consistent with FDIC APY disclosure standards and widely adopted in DeFi protocol documentation including Uniswap, Aave, and Compound.
How it works
From APR to APY — Why Compounding Changes Everything
Most DeFi protocols advertise Annual Percentage Rate (APR), which is the flat, non-compounded return. But yield farmers who regularly reinvest (harvest) their rewards benefit from compounding — earning returns on top of returns. The difference between APR and APY can be enormous at high rates. For example, a 100% APR compounded daily produces an APY of approximately 171.5%, not 100%. Understanding this distinction is fundamental to evaluating any DeFi opportunity.
The Formula
The APY formula is: APY = (1 + r/n)^n − 1, where r is the nominal annual rate (APR expressed as a decimal) and n is the number of compounding periods per year. For yield aggregators like Yearn or Beefy Finance that auto-compound hourly, n = 8,760. For manual farmers who compound weekly, n = 52. The more frequently rewards are reinvested, the higher the effective APY — though gas costs on networks like Ethereum can erode gains from very frequent compounding on smaller positions.
Impermanent Loss Adjustment
Liquidity providers in Automated Market Maker (AMM) pools such as Uniswap v2/v3, Curve, or Balancer face impermanent loss (IL) — a reduction in portfolio value relative to simply holding the assets outside the pool when token prices diverge. This calculator allows you to input an estimated IL percentage to compute a net return and net APY, giving a more honest projection of real-world outcomes. IL is 'impermanent' only if prices revert; if they do not, the loss is realised upon withdrawal.
Worked example
Scenario: A DeFi investor deposits $10,000 into a liquidity pool advertising an APR of 120%. They use an auto-compounder that reinvests rewards daily (365 times per year). They plan to hold for 180 days and estimate 5% impermanent loss on their position.
Step 1 — Calculate APY:
APY = (1 + 0.120/365)^365 − 1
= (1 + 0.000328767)^365 − 1
= (1.000328767)^365 − 1
≈ 1.27121 − 1 = 127.12% APY
Step 2 — Calculate Gross Return over 180 days:
Balance = $10,000 × (1 + 1.20/365)^(365 × 180/365)
= $10,000 × (1.000328767)^180
= $10,000 × 1.07679
≈ $17,679
Gross Return = $17,679 − $10,000 = $7,679
Step 3 — Subtract Impermanent Loss:
IL Cost = $10,000 × 5% = $500
Net Return = $7,679 − $500 = $7,179
Step 4 — Net APY:
Net APY ≈ 127.12% − 5.00% = 122.12%
This demonstrates that even after a 5% impermanent loss, the farming rewards significantly outpace the drag — but in pools with high token volatility, IL can easily exceed farming income, so always model conservatively.
Limitations & notes
Key Limitations to Understand:
APR stability: Yield farming APRs are highly volatile. As more liquidity enters a pool, the APR drops proportionally. A pool offering 300% APR today may offer 40% within a week. This calculator uses a fixed APR assumption, so projections over longer horizons should be treated as illustrative only.
Impermanent loss estimation: IL depends on the price ratio change between the two pooled assets. The estimate field in this calculator requires user input — for precise IL modelling based on price movements, use a dedicated impermanent loss calculator. Stablecoin-to-stablecoin pools (e.g., USDC/USDT on Curve) experience near-zero IL, while volatile pairs like ETH/ALTCOIN can suffer IL exceeding 50%.
Gas and transaction fees: On Ethereum mainnet, frequent compounding may cost $10–$50 per harvest transaction. This calculator does not account for gas costs, which can significantly reduce net returns for smaller positions. Layer 2 networks (Arbitrum, Optimism) and alternative L1s (Solana, Avalanche) have much lower fees, making frequent compounding more viable.
Smart contract risk: Yield farming returns are meaningless if a protocol is exploited. Rug pulls, oracle manipulations, and smart contract bugs have cost DeFi users billions of dollars. Always factor in protocol risk, audit status, and TVL stability when evaluating advertised yields.
Tax implications: In many jurisdictions, harvested yield farming rewards are taxable as ordinary income at the time of receipt, and each reinvestment may constitute a taxable event. Consult a crypto-specialised tax advisor before farming at scale.
Frequently asked questions
What is the difference between APR and APY in yield farming?
APR (Annual Percentage Rate) is the simple, non-compounded annual return rate advertised by most DeFi protocols. APY (Annual Percentage Yield) is the effective return when rewards are reinvested (compounded) over the year. At high rates common in DeFi — such as 100% APR — the difference is dramatic: daily compounding converts 100% APR into roughly 171.5% APY. Always compare protocols using the same metric to avoid misleading comparisons.
How does compounding frequency affect yield farming returns?
The more frequently rewards are compounded, the higher the effective APY. For a 100% APR position: annual compounding yields exactly 100% APY, monthly compounding yields ~104.7%, daily yields ~171.5%, and hourly yields ~171.8%. The marginal gain diminishes at very high frequencies, so the optimal compounding interval balances the mathematical benefit against gas transaction costs on the specific network.
What is impermanent loss and how does it affect yield farming profits?
Impermanent loss occurs when the price ratio of the two tokens in an AMM liquidity pool changes after deposit. The AMM rebalances holdings automatically, leaving the LP with less of the appreciating asset and more of the depreciating one compared to simply holding both tokens. The loss is 'impermanent' because it reverses if prices return to entry levels. However, in practice, many DeFi positions are withdrawn before prices revert, making the loss permanent. IL can range from under 1% for stablecoin pairs to over 50% for highly volatile token pairs.
What compounding frequency should I use for yield aggregators like Yearn or Beefy?
Yield aggregators such as Beefy Finance, Yearn, and Autofarm auto-compound rewards on your behalf — typically multiple times per day. For these protocols, select 'Hourly (8,760x/year)' or 'Daily (365x/year)' for a close approximation of their effective APY. The platform's own APY display accounts for their specific compounding schedule, so cross-reference this calculator's output with the protocol's stated APY to validate assumptions.
Is yield farming APY sustainable at rates above 100%?
Very high APYs in yield farming are almost never sustainable long-term. They typically reflect early incentive periods where protocols distribute large quantities of governance tokens to attract liquidity. As TVL (Total Value Locked) grows, rewards per dollar deposited decline. Additionally, if governance token prices fall due to selling pressure from reward distributions, the real USD-denominated APY drops sharply. Treat any APY above 50% with significant scepticism and model conservative projections assuming rapid APR decay.
Last updated: 2025-01-15 · Formula verified against primary sources.