Yield farming is the practice of depositing crypto into decentralised finance (DeFi) protocols, usually lending pools or the liquidity pools of a decentralised exchange, in return for a share of the fees those protocols earn, extra reward tokens, or both. Your return depends on whether that money comes from real activity, such as borrowers paying interest and traders paying swap fees, or from newly issued tokens. It can also be wiped out by price moves, impermanent loss or a smart contract failure.
How yield farming works
Lending pools
On a DeFi lending protocol, lenders deposit funds into a shared pool and borrowers draw from it. Ethereum.org describes these as "big pools of funds used for borrowing", where "lenders provide funds (liquidity) to a pool that borrowers can borrow from". Borrowers usually post collateral, and lenders earn the interest they pay.
Liquidity pools on decentralised exchanges
A decentralised exchange that uses an automated market maker (AMM) holds pairs of tokens in a pool and prices trades with a formula, not with an order book. A Bank for International Settlements (BIS) study from December 2021 notes that "the AMM protocol incentivises liquidity provision in two ways". Liquidity providers earn fees paid by traders, and they receive transfers generated by the pool's pricing curve.
Reward tokens: liquidity mining
Many protocols also pay depositors in their own governance token. Holding that token gives voting power over the protocol. Paying it out to users is usually called liquidity mining.
The best-known early case was Compound, a lending protocol. On 15 June 2020, it began distributing its COMP token to users. According to The Block's report from that day, "around 2,880 COMP will be distributed daily across the eight lending markets", and "users earn COMP proportionate to their balance on Compound in real-time". Compound's documentation says the protocol "is governed and upgraded by COMP token-holders".
Where the yield actually comes from
The headline rate on a farm usually combines two very different things.
- Fee or interest income. Borrowers pay interest and traders pay swap fees. This money comes from people using the protocol, so it shrinks or grows with demand.
- Token emissions. These are newly issued reward tokens. Their value depends on the token's market price, and each new token adds to its supply. If the price falls or the program ends, this part of the return falls with it.
A very high advertised rate is usually driven mostly by emissions. Before you compare farms, check which part of the rate is fees and which part is reward tokens, and in which token the rewards are paid.
APR and APY
APR is a simple annual rate. APY assumes the rewards are reinvested and compounded. The same farm can therefore show a higher APY than APR. Both are usually projections based on current conditions, not guaranteed returns.
How much does a price move cost a pool position?
Enter how far the relative price of your two tokens has moved and the fees you earned. The result is how your 50/50 pool position compares with simply holding the two tokens.
| Final exchange rate between the two tokens divided by the initial one (t) | Fees earned while the position was open, as a share of its value | Pool position vs simply holding the two tokens |
|---|---|---|
| 2 × | 0 % | -5.72 % |
| 4 × | 0 % | -20 % |
| 0.5 × | 0 % | -5.72 % |
| 2 × | 5.7 % | -0.02 % |
- The formula is the two-token impermanent loss formula for a 50/50 constant product pool, from Tiruviluamala, Port and Lewis (2022).
- The price ratio and fee values are your own inputs, not figures from any source.
- A negative result means the position is worth less than holding the two tokens. The loss is realised only if you withdraw while prices are still moved.
This calculator only compares the pool position with holding the tokens. It leaves out token price risk, reward-token emissions, smart contract failures, leverage and tax, and it cannot predict prices or fees.
Impermanent loss
When you provide two tokens to a 50/50 constant product pool, the pool rebalances as prices move. If the price of one token changes against the other, your position can end up worth less than if you had simply held the two tokens. This gap is called impermanent loss.
A 2022 paper by Tiruviluamala, Port and Lewis ("A General Framework for Impermanent Loss in Automated Market Makers") gives the two-token formula:
IL = 2√t / (t + 1) − 1
Here, t is the final exchange rate between the two tokens divided by the initial one. Applying the formula:
| Change in relative price | Impermanent loss vs holding |
|---|---|
| No change (t = 1) | 0% |
| Doubles or halves (t = 2 or 0.5) | about −5.7% |
| Quadruples (t = 4) | −20% |
The loss is called "impermanent" because it disappears if prices return to where they were when you deposited. If you withdraw after prices have moved, the loss is realised. Fees earned during that time can offset some or all of it, but nothing guarantees they will.
Main risks
- Smart contract bugs and exploits. Ethereum.org warns that DeFi products "can suffer from bugs and exploits". The BIS study notes that DeFi applications run autonomously, so outcomes "cannot be altered, even if erroneous". It cites two cases: a 2021 Compound reward-distribution error worth $90 million, and a flash loan attack in October 2020 that cost the Harvest protocol $27 million.
- Leverage and market stress. The BIS study finds that "high leverage in crypto markets exacerbates procyclicality". Farms that borrow to multiply rewards can be liquidated quickly when prices fall.
- Token price risk. Rewards paid in a volatile governance token can lose value faster than they build up.
- Governance concentration. The BIS argues that DeFi's decentralisation is partly an "illusion". Control "typically revolves around holders of 'governance tokens' (often platform developers)", who can change the rules a farm depends on.
- Weaker investor protection. IOSCO, the international body of securities regulators, published a report on DeFi in March 2022. It found that most DeFi services replicate traditional financial activities with less regulation and greater risk for investors. Deposits in a farm have no deposit insurance, and no intermediary is responsible for refunds.
A practical checklist before depositing
- Find out which part of the advertised rate comes from fees or interest and which part comes from reward tokens.
- Check what the reward token is, what its supply schedule is, and how easily it can be sold.
- For two-token pools, work out how much impermanent loss a realistic price move would cause, using the formula above.
- Read the protocol's documentation on audits, admin keys and who can change the contracts.
- Check whether the strategy uses leverage, and at what price it would be liquidated.
This article explains how yield farming works and is not investment advice. Rates, rules and risks differ by protocol and change over time.