Skip to main content

Yield Farming APY Calculator

Estimate yield farming returns accounting for compounding frequency, fees, and impermanent loss.

Share this calculator

Formula

APY = (1 + Daily Rate x 365/n)^n - 1

Where n is the number of compounding periods per year. The calculator applies this APY to your net deposit (after deposit fees), subtracts total gas costs for each compounding event, and reduces the final amount by the estimated impermanent loss percentage.

Worked Examples

Example 1: Daily Compounding DeFi Farm

Problem: You deposit $10,000 into a yield farm with 0.1% daily rate, daily compounding, $2 harvest gas cost, no deposit fee, and 2% estimated impermanent loss over 365 days.

Solution: APR = 0.1% x 365 = 36.5%\nAPY = (1 + 0.001)^365 - 1 = 44.03%\nGross value after 365 days = $10,000 x (1.001)^365 = $14,403\nGas costs = $2 x 365 = $730\nImpermanent loss = $14,403 x 2% = $288\nNet value = $14,403 - $730 - $288 = $13,385\nNet profit = $13,385 - $10,000 = $3,385

Result: Net Profit: $3,385 | Net ROI: 33.85% | APY: 44.03%

Example 2: Weekly Compounding with Deposit Fee

Problem: You deposit $5,000 into a pool with 0.15% daily rate, weekly compounding (52x/year), $5 harvest gas, 0.5% deposit fee, and 3% impermanent loss over 180 days.

Solution: Net deposit after fee = $5,000 x 0.995 = $4,975\nRate per compound = 0.15% x 7 = 1.05% per week\nCompounds in 180 days = floor(52/365 x 180) = 25\nGross value = $4,975 x (1.0105)^25 = $6,468\nGas costs = $5 x 25 = $125\nIL = $6,468 x 3% = $194\nNet value = $6,468 - $125 - $194 = $6,149\nNet profit = $6,149 - $5,000 = $1,149

Result: Net Profit: $1,149 | Net ROI: 22.98% | APR: 54.75%

Frequently Asked Questions

What is the difference between APR and APY in yield farming?

APR (Annual Percentage Rate) represents the simple interest rate earned over a year without accounting for compounding, while APY (Annual Percentage Yield) includes the effect of compound interest. In yield farming, the distinction is critical because most DeFi protocols display APR, but your actual returns depend on how frequently you compound your rewards. For example, a 100% APR compounded daily produces an APY of approximately 171.5%, nearly doubling the simple rate. The formula for converting APR to APY is: APY = (1 + APR/n)^n - 1, where n is the number of compounding periods per year. Always compare APY figures rather than APR when evaluating different yield farming opportunities.

What is impermanent loss in yield farming?

Impermanent loss occurs when you provide liquidity to an automated market maker (AMM) pool and the relative prices of the paired tokens change compared to when you deposited them. The loss is called impermanent because it only becomes realized (permanent) when you withdraw your liquidity. If the token prices return to their original ratio, the loss disappears. The magnitude of impermanent loss depends on the price divergence: a 25% price change causes approximately 0.6% IL, a 50% change causes 2% IL, a 100% change (price doubles) causes about 5.7% IL, and a 500% change causes roughly 25% IL. This is why many yield farmers prefer stablecoin pairs or correlated asset pairs, which experience minimal price divergence and therefore minimal impermanent loss.

How does compounding frequency affect yield farming returns?

Compounding frequency has a dramatic impact on yield farming returns, especially at higher APR levels. With a 100% APR and annual compounding, you earn exactly 100% per year. With daily compounding (365 times per year), the same APR yields approximately 171.5% APY. With hourly compounding, it reaches about 171.8% APY. The benefit of more frequent compounding diminishes as frequency increases, with the biggest jump occurring between annual and monthly compounding. However, each compounding event in DeFi requires a blockchain transaction that costs gas fees, so there is an optimal compounding frequency that maximizes returns after gas costs. For small deposits, compounding weekly or monthly is often more efficient, while large deposits benefit from daily or even more frequent compounding.

How do gas costs impact yield farming profitability?

Gas costs can severely erode or completely eliminate yield farming profits, especially on Ethereum mainnet for smaller deposits. Each harvest and compound operation requires a blockchain transaction costing anywhere from 2 to 50 dollars or more depending on network congestion. If you compound daily at 10 dollars per transaction, that is 3,650 dollars per year in gas alone. For a 10,000 dollar deposit earning 50% APY, your gross earnings would be 5,000 dollars, meaning gas costs consume 73% of your returns. The optimal strategy is to calculate the minimum deposit size and maximum gas cost at which compounding remains profitable. Many farmers use auto-compounding vaults like Beefy Finance or Yearn that batch user deposits together, spreading gas costs across many users and making frequent compounding viable for smaller amounts.

What are the main risks of yield farming?

Yield farming carries several significant risks beyond impermanent loss. Smart contract risk is the most fundamental danger, as bugs or vulnerabilities in the protocol code can lead to total loss of deposited funds through hacks or exploits, which have resulted in billions in losses across DeFi history. Rug pulls occur when developers intentionally drain liquidity pools or abandon projects after collecting deposits. Token price depreciation can eliminate farming rewards if the reward token loses value faster than you earn it. Protocol governance risks include sudden changes to emission rates or fee structures. Systemic risks from composability mean that a failure in one protocol can cascade to others that depend on it. Finally, regulatory risk looms as governments worldwide consider stricter crypto regulations that could affect DeFi protocols.

What is a realistic daily yield rate for sustainable farming?

Sustainable daily yield rates in yield farming vary widely depending on the asset pair, chain, and protocol, but realistic ranges are much lower than the eye-catching numbers often advertised. For major asset pairs like ETH-USDC on established protocols, sustainable daily rates typically range from 0.01% to 0.05% (3.65% to 18.25% APR). Stablecoin pairs like USDC-USDT may offer 0.005% to 0.03% daily (1.8% to 11% APR). Higher rates of 0.1% to 0.5% daily can exist but usually involve newer or riskier protocols, volatile token pairs, or unsustainable emission schedules. Any farm advertising rates above 1% daily (365% APR) should be approached with extreme caution, as these rates are almost always unsustainable and may indicate a Ponzi-like structure or imminent token value collapse.

References