Here's a scenario I see constantly: someone deposits 10,000 USDC into a farming pool advertising 15% APY. Six months later, they've earned roughly $750 in yield but lost $1,200 from impermanent loss and spent $400 in gas fees navigating a volatile market. They're down $850 and can't figure out what went wrong.

The answer is simple: they never ran the math.

Yield farming isn't complicated, but it requires doing actual work before you deposit. Most people skip this step, chase the highest advertised number, and end up worse off than if they'd just held. Let's fix that.

What Yield Farming Actually Is

At its core, yield farming is putting your crypto capital to work through DeFi protocols. You're earning a return on assets that would otherwise sit idle in your wallet. The yield comes from somewhere concrete: fees paid by borrowers, trading fees from decentralized exchanges, staking rewards from proof-of-stake networks, or token incentives distributed by protocols trying to grow their TVL (total value locked).

The mechanisms break into three categories, and understanding each one is prerequisite to doing this competently.

Lending is the simplest version. You're supplying assets to a lending protocol like Aave or Compound. Borrowers pay interest; you earn a share of that interest minus protocol fees. On volatile assets like ETH, this works well because you're holding the same asset you deposited—no impermanent loss risk.

Staking involves locking tokens to secure a proof-of-stake network. Validators and stakers earn rewards from inflation and transaction fees. Solo staking ETH currently yields around 4-5%, but requires 32 ETH and technical setup. Liquid staking protocols like Lido let you stake any amount and receive a liquid token (stETH, rETH) that you can then use elsewhere—meaning you can stack yields by putting that derivative back to work in lending markets.

Liquidity provision is where things get interesting—and dangerous. You're supplying two assets to a liquidity pool (say, USDC and ETH). Every trade through that pool generates fees paid to LPs. But here's what most people miss: your asset ratio changes as trades execute. If more USDC than ETH accumulates in the pool, you've effectively sold ETH. The "impermanent" loss is the cost of that silent selling.

The APY vs. APR Trap

This is where yield farmers get misled, and it's not even malicious—just a function of how protocols present numbers.

APR (annual percentage rate) is simple interest—the stated rate multiplied by the principal, divided by payment frequency.

APY (annual percentage yield) includes compounding. You earn interest on your interest.

The difference sounds small. It compounds into something significant.

A lending protocol advertising 12% APR compounds daily. Daily compounding means: APY = (1 + 0.12/365)^365 - 1 = 12.74%.

That's almost three-quarters of a percent more. On $100,000, that's $740 in free money you leave on the table by not understanding the difference.

But here's the trap: many DeFi protocols have variable yields that change block-by-block. A pool advertising 15% APY today might be earning 8% three weeks from now. That's not a bait-and-switch—it's just how supply and demand for borrowing work. Smart yield farmers check historical rates, not just current ones.

The Impermanent Loss Calculus

Impermanent loss is the most misunderstood concept in DeFi. Here's how it actually works mathematically.

You deposit 1 ETH and 2,000 USDC (total value $4,000 when ETH = $2,000) into a 50/50 ETH/USDC pool. The pool holds 1 ETH and 2,000 USDC by definition—it's auto-balancing.

ETH climbs to $3,000. The pool rebalances. You now hold 0.816 ETH and 2,449 USDC (using the constant product formula x * y = k). Total value: $2,449 + (0.816 * $3,000) = $4,897.

But if you'd just held the original 1 ETH and 2,000 USDC outside the pool: value = $5,000.

The difference: $103, or about 2.02%. That's your impermanent loss.

The formula: IL = 2√(price ratio) / (1 + price ratio) - 1

For ETH moving from $2,000 to $3,000: ratio = 1.5. IL = 2√1.5 / 2.5 - 1 = 2.34 / 2.5 - 1 = 0.936 - 1 = -0.064, or -6.4%.

Wait—I got different numbers because I'm mixing different scenarios. Let me recalculate cleanly:

When ETH moves from $2,000 to $3,000 (50% increase): the pool underperforms HODL by roughly 2%. That's the rule of thumb: impermanent loss roughly equals half the percentage price move, squared.

For a 50% move: IL ≈ (0.5)^2 * 0.5 = 0.25 * 0.5... no, the accurate formula is approximately (2 * sqrt(r) / (1 + r)) - 1 where r = new/old price.

For r = 1.5: IL = 2 * 1.225 / 2.5 - 1 = 2.45 / 2.5 - 1 = 0.98 - 1 = -2%.

For r = 2.0 (ETH doubling): IL = 2 * 1.414 / 3 - 1 = 2.828 / 3 - 1 = 0.943 - 1 = -5.7%.

This "impermanent" loss only stays impermanent if the price returns to where it started. It doesn't on assets that appreciate. ETH doesn't go back to $2,000. Solana doesn't retrace to your entry. These losses become permanent the moment you withdraw.

The yield breakeven calculation is what you need:

If you're in a USDC/ETH pool on Uniswap earning 0.3% trading fees per swap, and ETH moves 50%, you lose 2% to impermanent loss. You need to earn back that 2% from trading fees before you've made anything.

On high-volume pairs like WETH/USDC, fees accumulate fast enough to cover this. On obscure pairs with thin volume, you're just losing money while thinking you're earning yield.

Calculating Your Real Yield

Here's the spreadsheet logic you need before you deposit anywhere:

Step 1: Gross yield calculation Take the advertised APY. Subtract protocol fees (typically 5-15% of earnings). This is your gross yield.

Step 2: Impermanent loss estimate If you're in a volatile LP pair, calculate IL using the formula above based on a reasonable price move during your farming period. A 30% move in two weeks is not unusual in crypto.

Step 3: Net yield = Gross yield - IL - gas costs

Let's run a real example: $10,000 USDC in a USDC/ETH liquidity pool.

  • Gross trading fee APY: 8%
  • Protocol fee: 10% → Net fee APY: 7.2%
  • IL estimate for 25% ETH move in 30 days: roughly 1.5%
  • Gas: $40 to deposit, $40 to withdraw

Monthly: ($10,000 * 7.2% / 12) - IL value - gas = $60 - ($10,000 * 1.5% / 12) - $80 = $60 - $125 - $80 = -$145

You're down $145 in a "profitable" yield farm.

Where Sustainable Yields Actually Come From

Not all yield is created equal. Here's the hierarchy:

Genuine yields come from economically productive activity: lending interest, trading fees from actual volume, staking rewards from network economics. Aave's USDC lending yields around 3-5% because people genuinely borrow USDC for arbitrage, leverage, and operations. That yield is sustainable because it's backed by real economic activity.

Subsidized yields come from token emission programs—protocols distributing native tokens to attract liquidity. When a protocol offers 20% APY in their token on top of 5% from actual yields, you need to ask: what is that token worth? What's the vesting schedule? How much dilution is coming?

In 2021, many farms offered 200%+ APY in token emissions. Almost all of them crashed 90%+ within six months as emissions flooded the market and early investors sold. The yield looked incredible. The real return was negative.

The sustainable yield benchmark: For stablecoins, 3-8% APY from lending/actual activity is reasonable. Anything above that is either subsidized (and temporary) or involves hidden risks you're not accounting for. For volatile assets, yields should be higher to compensate for IL risk—but calculate whether the fee income actually covers the IL.

Practical Framework for Doing This Right

A yield farming strategy should look like this:

1. Define your goal first. Are you earning yield on stablecoins waiting for an entry point? That's different from maximizing returns on ETH you plan to hold for three years.

2. Calculate net APY before deposit. Run the full spreadsheet. Include gas costs—on Ethereum mainnet, gas alone can make small positions unprofitable.

3. Choose your venue. Mainnet Ethereum protocols offer the most battle-tested contracts. Arbitrum and Optimism offer the same protocols with pennies in gas fees. Solana has newer protocols with potentially higher yields but less track record.

4. Monitor and rebalance. Yields drift. What was a 7% USDC lending rate in January might be 4% in April. Set a calendar reminder to check rates monthly.

5. Don't chase farms. Gas costs and IL from rotating positions will kill you. Pick your positions deliberately and hold them for meaningful periods.

6. Never use leverage to farm yield. If you're borrowing USDC to deposit into a USDC yield farm, you're running a carry trade. When crypto markets get volatile, that leverage compounds against you in both directions. This is how people blow up their portfolios.

The Bottom Line

Yield farming can work. People do make real money doing it. But the people who lose money almost always share the same mistake: they saw a high APY number, deposited without calculating the real return, and discovered the gap between advertised yield and actual yield only after the damage was done.

Run the math. Account for impermanent loss. Include gas. If the numbers still work, you're probably in a reasonable position. If the numbers look good only because you're ignoring half the equation, that's not a yield farm—it's a slow bleed you're calling income.