Blockchain & Web3All articles

Yield Farming Explained: Strategies, APY, and Real Risks

Yield farming can generate real returns, but the headline APY rarely survives contact with impermanent loss, depegs, and contract risk. Here is how the mechanics actually work, where the money comes from, and the failure modes that quietly erase your gains.

Occasional field notes on building software — no spam

Idealogic — how to take advantage of defi and the risks of yield farming

Yield farming is the practice of putting idle crypto to work across DeFi protocols to earn more crypto, usually through lending, liquidity provision, or staking. The pitch is simple and the dashboards make it look effortless: deposit a token, watch an APY tick upward. The reality is messier. Most of the returns advertised on a farm are conditional, and the conditions are exactly the things that go wrong. This guide walks through how the mechanics work, where the yield comes from, and the specific ways it disappears.

We build and audit this kind of infrastructure, so the tone here is deliberately unsentimental. If you only read one section, make it the risk section.

What is yield farming and where the yield comes from

Bar chart comparing the durability of yield farming return sources, showing trading fees and lending interest as far more durable than token incentives.
Trading fees and lending interest outlast token emissions as return sources

At its core, yield farming routes your capital into a protocol that needs it and pays you for the privilege. The capital does something useful — it backs loans, it sits in a trading pool, it secures a network — and the protocol shares the revenue or mints new tokens to compensate you.

There are three primary sources of return, and they are not equally durable:

  • Trading fees. When you supply two assets to a decentralized exchange pool, traders pay a fee (commonly 0.3% on a Uniswap v2-style pool) that is split among liquidity providers in proportion to their share. This is real revenue tied to real volume.
  • Lending interest. Protocols like Aave and Compound let you supply assets that borrowers draw against. Rates float with utilization. Supplying ETH might pay a low single-digit APY in calm markets and spike when borrowing demand surges.
  • Token incentives. A protocol mints its own governance token and hands it to depositors to bootstrap liquidity. This is the part that produces the eye-watering numbers, and it is the least reliable, because the token's price can collapse faster than you earn it.
The headline APY is a marketing number. The durable yield is whatever survives after fees, token price decay, and impermanent loss.

If you want the broader context for how these protocols fit together, our explainer on how DeFi protocols are structured and what each type actually does covers the building blocks — AMMs, lending markets, and stablecoins — that yield farming sits on top of.

How yield farming works in practice

The mechanics differ by strategy, but the shape is consistent: deposit, receive a claim on your position, earn over time, then unwind. Three strategies cover most of what farmers actually do.

Liquidity provision and liquidity mining

You deposit a pair of assets — say ETH and USDC — usually at roughly equal value, into an automated market maker pool. In return you get LP tokens representing your share. Those LP tokens earn a cut of trading fees automatically.

Liquidity mining is the layer on top: many protocols ask you to stake those LP tokens into a separate contract that pays additional rewards in the protocol's native token. So you can earn fees and emissions simultaneously. This is where the big advertised APYs come from, and also where most of the hidden risk lives, because you are now exposed to two assets plus a third reward token whose value you do not control.

Lending and borrowing

The simplest farm. You supply an asset to a lending market and earn interest from borrowers. Borrowers post collateral worth more than they take out — overcollateralization is the norm in DeFi because there is no credit check. A common move is to supply a volatile asset, borrow a stablecoin against it, and deploy that stablecoin elsewhere. That is leverage, and it cuts both ways: a price drop can push your collateral toward liquidation while you are not watching.

Staking

You lock tokens to help secure a proof-of-stake network or a protocol and receive rewards in the same token. Ethereum staking is the canonical example. It is the closest thing DeFi has to a savings rate, but it is not risk-free — slashing, validator downtime, and lock-up periods all apply, and liquid staking tokens introduce depeg risk of their own.

What is yield farming APY actually telling you — APY vs APR

Line chart showing how a fixed 20 percent APR reads as a higher APY as compounding frequency increases from none to daily.
A flat 20% APR reads higher as compounding frequency rises

The single most useful skill for a farmer is reading the rate correctly. The numbers on a farm's front page routinely overstate what you will keep.

APR (annual percentage rate) is the simple annualized return with no compounding. If a pool shows 20% APR, you earn roughly 20% over a year on your principal, paid out as rewards.

APY (annual percentage yield) assumes you compound — you harvest rewards and redeposit them on a schedule. Frequent compounding inflates the headline number. A 20% APR compounded daily becomes about 22% APY. On a farm advertising 400% APR, the APY can read in the thousands, which is mostly an artifact of the compounding math, not free money.

Two warnings:

  • APY assumes the reward token holds its price. Most emission-driven APYs are quoted as if the token you receive is worth what it is worth today. If emissions are heavy and demand is thin, the price falls as you earn, and your realized yield is a fraction of the quoted figure.
  • Compounding has a gas cost. On expensive chains, harvesting and redepositing frequently can cost more than it earns on a small position. The "auto-compounder" vaults that batch this for many users exist precisely because doing it manually is inefficient.

Treat any APY above, say, 50% as a question rather than a promise: where is this coming from, and what has to stay true for it to last?

Yield farming risks that quietly erase your returns

Donut chart breaking down yield farming failure modes by relative frequency, with impermanent loss and smart-contract risk the largest shares.
Impermanent loss and contract risk catch farmers most often

This is the section that matters. A farm can show a great APY and still lose you money. Here are the failure modes, roughly in order of how often they catch people.

Impermanent loss

When you provide liquidity to a two-asset pool, the AMM rebalances your holdings as prices move. If one asset rises sharply relative to the other, you end up holding more of the loser and less of the winner compared to simply holding both. The gap between "what your LP position is worth" and "what holding the two tokens would have been worth" is impermanent loss.

It is only "impermanent" if prices revert. If they do not, the loss is real when you withdraw. For volatile pairs, impermanent loss can easily exceed the fees you earned. This is why stablecoin pairs and correlated pairs (like ETH and an ETH liquid-staking token) are popular — the assets move together, so divergence stays small.

Stablecoin depegs

Much of DeFi yield is denominated in stablecoins, and the entire premise is that a "dollar" stays a dollar. When it does not, the damage is fast. Algorithmic and undercollateralized stablecoins have collapsed to near zero; even collateralized ones briefly traded well below a dollar during banking stress. If you are farming a high yield on an obscure stablecoin, that yield is partly compensation for depeg risk, whether or not the dashboard tells you so.

Smart-contract risk

Your capital sits inside code. Bugs, logic errors, and exploited vulnerabilities have drained pools that looked battle-tested. An audit reduces this risk but does not eliminate it — plenty of audited protocols have been exploited through novel attack vectors, oracle manipulation, or flawed upgrades. The older, more heavily used, and more thoroughly reviewed a contract is, the better your odds, but "TVL is high" is not the same as "this is safe."

Rug pulls and malicious design

A team launches a farm with a generous APY, attracts deposits, then drains the pool or dumps a pre-mined token allocation and vanishes. Sometimes the contract itself contains a backdoor — a mint function, an unrestricted withdrawal, an upgradeable proxy controlled by a single key. Anonymous teams, unaudited code, and yields that make no economic sense are the classic warning signs. If you cannot explain where the return comes from, assume the answer is "from the next depositor."

If the yield has no obvious source in fees or interest, the source is probably your principal.

Bridge, oracle, and composability risk

DeFi's strength is that protocols stack on each other. That is also a weakness: a farm built on top of three other protocols inherits the risk of all three. Cross-chain bridges have been among the largest single points of failure in the space. A price oracle feeding bad data can trigger wrongful liquidations or let an attacker drain a market. The more legos in your position, the more ways it can break.

A practical risk checklist before you deposit

Left-to-right flow diagram of the pre-deposit risk checklist, from tracing yield through sizing for total loss to depositing.
The pre-deposit checklist turns hidden risk into legible steps

Before committing capital to any farm, run through the basics:

  • Trace the yield. Identify whether it comes from fees, interest, or emissions. Emission-heavy yields decay; price in that the token will likely fall.
  • Check the audit and the age. Read who audited it and when. Favor contracts that have held large value for a long time without incident.
  • Understand the pair. Volatile pairs carry impermanent loss; correlated and stablecoin pairs carry less. Know which you are in.
  • Size for total loss. Treat each position as something that could go to zero from an exploit. Do not allocate more than you can afford to lose.
  • Watch liquidation thresholds. If you borrowed against collateral, know your liquidation price and leave a wide margin.

None of this makes yield farming safe. It makes the risk legible, which is the most any honest guide can offer.

Where Idealogic fits

We do not give financial advice and we will not tell you which farm to enter. What we do is build, audit, and harden the systems underneath — AMMs, lending markets, staking contracts, and the monitoring that catches problems before they become headlines. If you are designing a protocol that other people will farm, the bar is higher: your users inherit every assumption you bake into the code.

Our blockchain development team ships and reviews this kind of infrastructure end to end, from contract architecture to incident response. For a wider view of how decentralized finance is reshaping the rails of the financial system, our piece on DeFi development and the move toward open finance is a good companion read.

Yield farming rewards people who understand the mechanism and respect the failure modes. The returns are real for those who do the work; the losses are equally real for those who chase the biggest number on the screen.

Build your blockchain product with a team that ships
Talk to our blockchain engineers

Frequently asked questions

  • Yield farming means putting your crypto to work in DeFi protocols to earn more crypto. You deposit assets into lending markets, liquidity pools, or staking contracts, and the protocol pays you through interest, a share of trading fees, or newly minted reward tokens. The returns vary widely and are never guaranteed.

  • APR is the simple annualized return without compounding. APY assumes you harvest and reinvest rewards on a schedule, so frequent compounding inflates the number. A 20% APR compounded daily reads as roughly 22% APY. Both usually assume the reward token holds its price, which it often does not.

  • Impermanent loss is the gap between holding two tokens outright and supplying them to a liquidity pool when their prices diverge. The bigger the divergence, the larger the loss. You reduce it by using correlated or stablecoin pairs that move together, and by confirming that trading fees outweigh the expected divergence.

  • No yield farming position is fully safe. The main risks are smart-contract exploits, impermanent loss, stablecoin depegs, and outright rug pulls by malicious teams. Audited, long-lived protocols with transparent yield sources carry lower risk, but exploits still happen. Only allocate capital you can afford to lose entirely.

  • Watch for anonymous teams, unaudited code, and yields too high to explain. If you cannot trace where the return comes from in fees or interest, the likely source is other depositors' principal. Check for backdoors like unrestricted mint or withdrawal functions and single-key control over upgradeable contracts.

  • Yield farming is the broad practice of earning returns across DeFi. Liquidity mining is one method within it: you supply assets to a pool, then stake the resulting LP tokens to earn extra rewards in the protocol's native token. It stacks fee income with token emissions, which boosts headline APY but adds reward-token price risk.

Related expertise