DeFi yield farming: what it actually is and how it works

Most explanations of yield farming describe what you earn, not how. This article covers the mechanics: where the yield comes from, what makes it sustainable, and what kills it. No speculation. No hype.

By · · 9 min read

DeFi Yield Farming - DeFihouse Playbook
DeFi Yield Farming - DeFihouse Playbook

Yield farming is putting crypto assets to work inside decentralized finance protocols to earn a return. That return can come from interest paid by borrowers, fees paid by traders, or token incentives paid by protocols looking to attract liquidity. Each of those sources has different mechanics, different risks, and different sustainability.

The term gets used loosely. Depositing stablecoins into a lending protocol at 6% APR is technically yield farming. So is running an active liquidity position on a volatile trading pair. These are not the same thing. The risk profiles, time requirements, and skill floors are completely different. Understanding which category you are operating in is the first decision that matters.

"DeFi is like a vast ocean. Retail participants stand at the shore, seeing only the waves. The job is to build submarines - to go beneath the surface where the real value flows."

Where the yield comes from

Every source of DeFi yield traces back to one of three mechanisms. Knowing which one you are using tells you who is paying you, and why they keep paying.

Lending

Decentralized lending protocols like Aave and Compound let anyone deposit assets into a shared pool. Borrowers take overcollateralized loans from that pool and pay interest. Lenders earn a share of that interest proportional to their deposit.

Overcollateralized means the borrower must lock up more value than they borrow, typically 130-150% or more. If the collateral value drops too close to the loan value, the protocol automatically liquidates the collateral to repay the debt. The lender is protected by the math, not by trust.

Lending rates are variable. They move with supply and demand. When a lot of traders want to borrow (usually during bull markets when people want leveraged exposure), rates go up. When demand is low, rates compress. Stablecoin lending typically sits between 4-10% annually in normal conditions, with spikes during periods of high market activity.

Liquidity provision

Decentralized exchanges (DEXs) like Uniswap, Raydium, and Orca don't hold inventory. Instead, they rely on liquidity providers (LPs) who deposit token pairs into pools. When a trader swaps tokens, they trade against the pool. The LP earns a percentage of every swap that goes through their liquidity.

Fee tiers typically range from 0.01% to 1% per trade depending on the pair and protocol. On high-volume pairs, those fees compound into meaningful returns. The LP earns regardless of which direction trades go. Volume is what generates income, not price direction.

The critical development in LP mechanics was concentrated liquidity, introduced by Uniswap V3. Traditional pools spread capital across all possible prices from zero to infinity, leaving most of it idle at price levels that would never be reached. Concentrated liquidity lets providers focus their capital within a specific price range, making it far more efficient. The same capital earns more fees because it covers only the prices where actual trading happens.

Protocol incentives

Many protocols distribute their own governance or reward tokens to users who deposit or provide liquidity. This is the category that gave yield farming its reputation for triple-digit APYs in 2020 and 2021. The yields were real, but they depended on the value of tokens being distributed. As those tokens lost value, the real returns collapsed.

Incentive-based yield is the least predictable of the three. It can supercharge returns on a new protocol in the short term, but it is not a standalone yield source. At DeFihouse, we treat incentive tokens as a bonus on top of lending or LP income, never as the primary reason to deploy capital.

How liquidity pools work

Most DEX pools use an automated market maker (AMM) model. There is no order book, no matching engine, and no counterparty. Instead, a mathematical formula determines the price based on the ratio of tokens in the pool.

The most common formula is x * y = k, where x and y are the quantities of each token and k is a constant. When someone buys token A from the pool, they add token B and remove token A. The ratio shifts, the price of A rises, the price of B falls. The formula adjusts automatically, with no human intervention.

This creates a self-balancing system. Arbitrageurs keep prices aligned with the broader market by trading whenever the pool price drifts from the market price. That arbitrage activity is part of the trading volume that generates fees for LPs.

Impermanent loss

Impermanent loss (IL) is the central risk of liquidity provision. It is widely misunderstood because the name makes it sound temporary and harmless. It can be both, but it can also be permanent.

When you deposit two tokens into a pool and the price of one changes significantly relative to the other, the pool rebalances your position. You end up with more of the token that fell in price and less of the one that rose. Compared to simply holding the original amounts outside the pool, you are worse off. That difference is impermanent loss.

It is called impermanent because if the price returns to your entry point, the loss reverses. In practice, prices often do not return. And in a concentrated liquidity position, IL is amplified because the capital is more tightly focused on a specific range.

The calculation that matters is not whether IL exists, but whether fee income exceeds it over the life of the position. A high-volume, low-volatility pair where the price stays in a tight range is a good LP candidate. A low-volume, high-volatility pair where the price moves widely is a poor one, regardless of what the fee APR looks like on day one.

Common Mistake

Narrow concentrated ranges generate high fee APRs on paper but trigger frequent rebalancing. Each rebalance costs slippage. In volatile markets, a position showing 100%+ annualized fee income can produce negative net returns once rebalancing costs are counted. Fee APR and net profit are not the same number.

The risks that matter most

Yield farming has a standard list of risks: smart contract bugs, protocol exploits, token volatility, and rug pulls on newer projects. Those are real. But the risks that cause the most consistent losses among active participants are operational.

  • Liquidation in leveraged positions. Any strategy that borrows against collateral carries liquidation risk. The protocol monitors your health factor (collateral value divided by debt). If it drops below 1.0, the protocol liquidates your collateral automatically and charges a penalty. This happens fast during sharp market moves. Conservative loan-to-value ratios and active monitoring are not optional.
  • Out-of-range LP positions. In concentrated liquidity, if the price moves outside your range, you stop earning fees entirely. Your capital sits idle until you rebalance. Positions require active monitoring and adjustment, especially during volatile periods.
  • Rate compression. Lending rates are variable. A position that earns 10% APR during a bull market may compress to 3% when borrow demand drops. Any strategy that depends on a specific rate staying fixed needs a plan for when it doesn't.
  • Protocol risk. Smart contract bugs and exploits are rare in established protocols with large total value locked (TVL) and multiple independent audits, but they are not zero. Diversifying across protocols and sticking to battle-tested platforms with clean audit histories reduces but does not eliminate this risk.
  • Stablecoin depeg. Many yield strategies run on USDC or USDT. If either depegs materially from $1.00, positions denominated in that stablecoin are affected immediately. USDC depegged briefly to $0.87 during the Silicon Valley Bank collapse in March 2023. It recovered, but positions that needed to exit during that window took real losses.

Compounding and sustainability

DeFi protocols accrue yield continuously, often by the block. This means compounding can happen daily rather than annually. The difference is significant. A 4% monthly yield compounded monthly delivers 60% over 12 months, not 48%. Over 24 months, 157%.

The practical implication: reinvesting yield back into the position, even partially, has a larger effect in DeFi than in traditional finance because the compounding frequency is so high. Positions that reinvest fees grow faster and are more resilient to periods of underperformance.

Sustainability means the position can keep running without eroding principal. The most common failure mode is not a single bad trade. It is slow capital erosion: rebalancing costs, fee compression, and occasional IL that each individually seem minor but compound into a position that shrinks over time until it is no longer viable. A sustainable position earns more than it loses to costs, on a net basis, consistently.

Market conditions change what works

Yield farming is not a static activity. The same capital deployed the same way produces very different outcomes depending on market conditions.

Lending income is highest when borrow demand is high, which typically means bull markets with traders wanting leveraged exposure. Lending during bear markets still works but at lower rates.

LP income is highest when trading volume is high and price stays within range. Sideways markets with lots of activity are the ideal LP environment. Sharp trending moves create impermanent loss faster than fees can offset it.

The operators who perform consistently across conditions are the ones who adjust. They widen LP ranges during high-volatility periods to reduce rebalancing costs. They shift toward lending when directional risk is elevated. They hold more in reserve during uncertain regimes rather than staying fully deployed at all times.

Identifying what market condition you are in before deploying capital is the decision that matters most.

How to think about returns

Yield is quoted in APR (annual percentage rate, without compounding) or APY (annual percentage yield, with compounding). DeFi protocols typically show APR. Always check which one you are looking at.

Quoted yields are usually forward-looking estimates based on recent activity. A pool showing 40% APR based on last week's volume may earn nothing this week if volume dries up. Treat high APR figures from new or incentive-heavy pools with proportional skepticism.

The more useful number is net return: fees earned minus impermanent loss, rebalancing costs, and gas fees, divided by capital deployed. That number is harder to find displayed anywhere. It requires tracking position value over time. Tools exist to help, but the discipline to track it has to come from the operator.

The bottom line

Yield farming works because decentralized protocols need liquidity to function and pay for it. Lending protocols need lenders. DEXs need liquidity providers. The yield is real because the service being provided is real.

What makes it hard is that the same mechanics that generate yield also generate risk, and those risks require active management. A passive approach can work at the conservative end: stablecoin lending in established protocols requires minimal monitoring and carries limited downside. Every step toward higher yield requires a corresponding step in skill, attention, and risk tolerance.

The yield is there. The question is whether you understand what you are doing well enough to keep it.

Further Reading and Sources