How to Calculate Yield Farming Returns: APR vs APY Guide
Aug, 20 2026
You see a pool offering 200% APY. You deposit $1,000. Six months later, your portfolio is down 40%. What went wrong? The headline number didn't lie, but it also didn't tell the whole story. Calculating real returns in decentralized finance (DeFi) requires looking past the marketing numbers and understanding the mechanics of compounding, fees, and hidden risks like impermanent loss.
This guide breaks down how to actually calculate what you will make or lose. We will move beyond simple interest formulas to cover the variables that change daily, from trading volume to token emissions. By the end, you will have a clear method to evaluate any opportunity before you lock up your capital.
Key Takeaways
- APR vs. APY: APR ignores compounding; APY includes it. Always use APY for reinvested rewards to get an accurate picture of growth.
- Impermanent Loss is Real: High yields can be wiped out if the asset price moves significantly compared to its paired asset. You must calculate this separately.
- Fees Eat Into Net Returns: Protocol fees, gas costs, and entry/exit spreads reduce your final profit. A 50% APY might only net you 35% after all costs.
- Variable Rates: DeFi rates are not fixed. They fluctuate based on liquidity depth and demand. Your calculated return is a snapshot, not a guarantee.
The Core Metrics: APR and APY Explained
Most confusion starts here. Protocols often display both metrics, sometimes interchangeably, which leads to misjudged expectations. Let's clarify the difference using concrete examples.
Annual Percentage Rate (APR) is simple interest. It tells you how much interest you earn relative to your principal over a year, assuming you do nothing with those earnings. If you lend $1,000 at a 10% APR, you earn $100. That's it. No more, no less, unless you manually take that $100 and lend it again.
Annual Percentage Yield (APY) accounts for compound interest. This is the metric that matters when you are "farming"-that is, automatically reinvesting your rewards. Because you are earning interest on your interest, the effective rate grows over time. The formula for APY is:
APY = (1 + r/n)^n - 1
Where r is the annual interest rate (APR) and n is the number of compounding periods per year. In many DeFi protocols, rewards are distributed every block or every day, meaning n can be very high (e.g., 365 for daily compounding).
| Compounding Frequency | Periods (n) | Resulting APY | Gain Over Simple APR |
|---|---|---|---|
| Annually | 1 | 100% | 0% |
| Monthly | 12 | ~268% | +168% |
| Daily | 365 | ~377% | +277% |
| Continuously | ∞ | ~368% | +268% |
Notice the jump. At high rates common in DeFi, the difference between APR and APY is massive. If a protocol quotes 100% APR but compounds daily, your actual yield is closer to 377%. However, if the protocol distributes rewards weekly, the APY drops. Always check the distribution frequency in the contract code or documentation.
Calculating Impermanent Loss
This is the step most beginners skip, and it’s where portfolios go to die. When you provide liquidity to a pair (like ETH/USDC), you don't just hold one asset. You hold a basket. If the price of ETH goes up, your share of the basket shifts toward USDC. If ETH goes down, it shifts toward ETH. Compared to simply holding ETH, you lose value. This is impermanent loss (IL).
It is called "impermanent" because if the prices converge back to their original ratio, the loss disappears. But in volatile markets, they rarely converge quickly.
To calculate IL, you need the price change percentage. Here is a simplified rule of thumb for stable pairs versus volatile pairs:
- Stable/Stable (e.g., USDT/USDC): IL is negligible (usually <1%).
- Volatile/Stable (e.g., ETH/USDC): If ETH rises 50%, IL is approximately 3.7%. If it rises 100%, IL is about 9.1%.
- Volatile/Volatile (e.g., BTC/ETH): IL depends on the relative movement between the two assets. If BTC stays flat and ETH doubles, IL is roughly 9.1%.
You must subtract this potential loss from your gross yield. If you earn 20% APY but face a 10% IL due to price divergence, your net gain is only 10%. If the price moves against you by 20%, you might break even despite the yield.
Factoring in Fees and Costs
Your wallet balance doesn't update in isolation. Several costs chip away at your returns.
- Protocol Fees: Most AMMs (Automated Market Makers) charge a fee on every swap (typically 0.05% to 0.3%). As a liquidity provider, you earn a share of these fees. This is usually included in the base APR. However, some protocols take a cut of the LP rewards. Check the "protocol fee" setting in the contract.
- Gas Costs: Every transaction costs gas. On Ethereum mainnet, entering and exiting a pool can cost $20-$50 each. If you farm small amounts frequently, gas eats your profits. On Layer 2s like Arbitrum or Optimism, or chains like Solana, gas is pennies, making smaller farms viable.
- Slippage and Spread: When you enter or exit a pool, you pay the bid-ask spread. In thin pools, this can be significant. Use limit orders or wait for low-volume periods to minimize this impact.
A practical formula for Net Return looks like this:
Net Return = (Gross APY × Time) - (Impermanent Loss %) - (Total Fees %)
Using Calculators and Tools Effectively
Doing this math by hand is error-prone. Use dedicated tools. Platforms like DefiLlama, Dune Analytics, or specific protocol dashboards provide real-time data. Look for these features in a calculator:
- Historical Data: Does it show average APY over the last 30 days, not just today's spike?
- Risk Adjusted Metrics: Some advanced tools factor in volatility to estimate expected IL.
- Tax Implications: While not always built-in, remember that every reward distribution is a taxable event in many jurisdictions. A 10% tax rate reduces your net yield by 10%.
Cross-reference at least two sources. If one site says 500% APY and another says 120%, investigate why. Usually, the higher number includes temporary incentive tokens that may crash in value shortly after distribution.
Leveraged Yield Farming: The Math Gets Dangerous
Leverage amplifies everything. If you borrow funds to increase your position size, your returns multiply, but so do your losses and liquidation risk.
Suppose you have $1,000. You borrow $3,000 at a 10% interest rate to farm a pool yielding 30% APY. Your total position is $4,000.
- Gross Earnings: $4,000 × 30% = $1,200
- Borrowing Cost: $3,000 × 10% = $300
- Net Profit: $900
- Return on Equity (ROE): $900 / $1,000 = 90%
That looks great. But if the asset price drops 10%, your collateral value drops. If the liquidation threshold is hit, you lose your initial $1,000 plus owe the remaining debt. Always calculate your liquidation price before entering a leveraged position. The margin of safety should be wide enough to absorb normal market swings without triggering liquidation.
Common Pitfalls to Avoid
Even with correct math, behavioral errors kill returns.
- Chasing High Yields: A 1,000% APY usually signals a new, unproven token or a dying protocol trying to attract liquidity. The underlying asset often loses 90% of its value within weeks.
- Ignoring Token Utility: Rewards paid in governance tokens require you to sell them to realize cash. Selling adds slippage and tax events. Holding them exposes you to further price decay.
- Static Assumptions: Rates change. A pool that pays 50% today might pay 5% next week as more farmers join. Monitor your positions regularly.
Building Your Personal Calculation Framework
Create a simple spreadsheet or note template for every opportunity. Fill in these fields:
- Base Asset Pair: e.g., WBTC/ETH
- Current APY: From the protocol dashboard
- Compounding Frequency: Daily, Weekly, etc.
- Estimated IL: Based on recent volatility (use historical data)
- Total Fees: Entry gas + Exit gas + Protocol cut
- Tax Rate: Your local short-term capital gains rate
- Net Expected Return: (APY - IL - Fees - Tax)
If the Net Expected Return is negative or below your risk-free alternative (like a stablecoin savings account), walk away. The goal isn't just to earn yield; it's to earn *risk-adjusted* yield that beats doing nothing.
Is APY always better than APR?
Not necessarily. APY assumes you reinvest all rewards instantly and without cost. If you plan to withdraw rewards monthly to pay bills, APR is a more accurate reflection of your cash flow. However, for long-term holding strategies, APY is the superior metric for comparing growth potential.
How do I calculate impermanent loss precisely?
You can use online IL calculators that input the starting and ending prices of both assets. The formula involves square roots and ratios of the price changes. For quick estimates, remember that a 2x price increase in one asset results in roughly 9.1% IL for a constant product AMM like Uniswap V2.
Do gas fees matter for large positions?
Less so. If you are farming $100,000, a $50 gas fee is 0.05%, which is negligible compared to a 20% yield. However, for positions under $5,000, gas fees can consume 1-5% of your capital per cycle, significantly impacting net returns. Choose networks with lower fees for smaller farms.
What happens if the reward token crashes?
Your realized yield drops. If you earned 100% in Token X, but Token X loses 80% of its value before you sell, your actual profit is only 20% (minus fees). Always value rewards in USD terms, not token quantity, when calculating returns.
Should I use leveraged yield farming?
Only if you understand liquidation mechanics deeply. Leverage turns small price movements into large equity swings. It is suitable for experienced traders who actively monitor positions and set tight stop-losses. For passive investors, unleveraged farming is safer and simpler to calculate.