hedgefund.wiki — institutional knowledge base

Yield Farming

Crypto & Digital Assets · intermediate · CC-BY-4.0

Yield farming (also called liquidity mining) is the practice of deploying cryptocurrency assets into decentralized finance (DeFi) protocols—such as liquidity pools, lending platforms, or governance staking programs—to earn rewards in the form of interest, trading fees, or newly issued governance tokens.

Key takeaways

Explanation

Yield farming emerged during the 'DeFi Summer' of 2020, catalyzed by Compound Finance's launch of its COMP governance token distribution program in June of that year. Compound began distributing COMP tokens to borrowers and lenders on its protocol proportionally to their usage, effectively paying users to interact with the platform. The resulting APYs—in some cases exceeding 100% annualized—attracted massive capital inflows and inspired dozens of similar programs across protocols, establishing yield farming as a defining feature of the DeFi ecosystem.

The mechanics of yield farming vary by protocol type. In automated market maker (AMM) platforms such as Uniswap and Curve Finance, liquidity providers (LPs) deposit equal values of two tokens into a trading pool and receive LP tokens representing their share of the pool. These LP tokens earn a portion of the trading fees generated whenever the pool is used (typically 0.05%–0.30% per swap, depending on the pool). Additionally, protocols often distribute their own governance tokens to LPs as 'liquidity mining' rewards, creating a second layer of yield on top of fee income. Yield farmers seeking maximum returns stake their LP tokens in additional 'farm' contracts to earn these extra rewards.

Impermanent loss is the most distinctive and often underappreciated risk in AMM yield farming. When the relative price of the two tokens in a liquidity pool diverges from the ratio at the time of deposit, the AMM's constant-product formula (x × y = k) rebalances the pool continuously, causing LPs to sell the appreciating asset and buy the depreciating one—the opposite of what an unmanaged position would do. This mechanical rebalancing creates a 'loss' relative to simply holding the two tokens, which is 'impermanent' only if prices revert to the original ratio. Concentrated liquidity provisions (as introduced by Uniswap v3) allow LPs to provide liquidity within specified price ranges, dramatically increasing fee income but also increasing impermanent loss sensitivity.

The yield farming landscape is characterized by rapid innovation and equally rapid risk accumulation. New protocols routinely offer extremely high initial APYs (sometimes in the thousands of percent) to attract liquidity. These yields are largely driven by token emissions that are inherently inflationary—as governance tokens are distributed to farmers, their supply grows and prices often decline, eroding real returns. Sophisticated yield farmers pursue strategies involving cross-protocol collateral loops (depositing one protocol's LP token as collateral to borrow stablecoins, which are then reinvested into other protocols), flash loan-assisted arbitrage, and MEV (maximal extractable value) capture to maximize risk-adjusted returns.

Formula

IL = 2 \cdot \frac{\sqrt{k}}{1+k} - 1, \text{ where } k = \frac{P_{final}}{P_{initial}}

Example

During the DeFi boom of 2021, a yield farmer deposits $100,000 worth of USDC and ETH (50/50) into the Uniswap v3 ETH/USDC pool, concentrating liquidity between $1,800 and $2,200 per ETH (ETH is at $2,000 at the time of deposit). Over the next three months, ETH averages $1,950 and the pool generates substantial fee income: the farmer's position earns approximately $8,400 in fees (an annualized rate of ~33.6% on the liquidity deployed). Simultaneously, the DeFi protocol where the LP tokens are staked distributes $6,000 worth of governance tokens as liquidity mining rewards. Total gross income is $14,400. However, due to ETH's price declining slightly and the concentrated position's impermanent loss, the LP tokens are worth $97,200 when withdrawn—$2,800 less than the original deposit. Net income after impermanent loss is $14,400 − $2,800 = $11,600, representing approximately 11.6% over three months.

Related terms

Arbitrage Automated Market Maker Cryptocurrency Flash Loan Liquidity Liquidity Pool Market Maker Mev Maximal Extractable Value Mining Proof Of Stake Staking Swap