What Is Yield Farming?
A Step-by-Step Guide to One of DeFi's Most Popular Practices
By: Rahul Nambiampurath •DeFi Tutorials
It could be said that yield farming is a quest for lifelong fulfillment. One doesn’t have to go farther than to remember the quote from the billionaire investor Warren Buffett:
“If you don’t find a way to make money while you sleep, you will work until you die.”
As sayings go, they are always easier said than done. However, blockchain assets within the decentralized finance (DeFi) continuum offer yield farming opportunities like never before in history. Terra and Celsius Network may have gone down the toilet, but one should keep in mind that they were CeFi lending platforms, not DeFi.
The likes of Aave, Curve, and Uniswap, in addition to Ethereum staking, still offer yields that overshadow the average savings account rate of 0.1%. This yield farming guide covers everything a passive income seeker needs to know to get started.
Yield Farming vs. Traditional Banking
What is understood by yield farming is any process that locks in crypto assets for passive income generation. This income is commonly represented as APY percentage — Annual Percentage Yield, sometimes referred to as EAR (Effective Annual Rate). It measures a future gain from an initial investment.
- Adam deposits $500 into a DeFi protocol with an APY of 6%.
- The 6% interest rate compounds every quarter.
- The formula to calculate it is APY= (1 + r/n)n – 1, where the “r” is the annual interest rate, while the “n” is the number of compounding periods.
Since the compounding pays every quarter (every three months) and the year has 12 months, n=4. With r=6% (0.06) and n=4, APY on a $500 deposit translates to a yield farming gain of $30.68, increasing the initial deposit from $500 to $530.68.
In yield farming, there is another metric to be accounted for — APR (Annual Percentage Rate). Unlike APY, APR doesn’t take into account the compounding interest, which is just a rate that accumulates on both the initial deposit and on the periodic accumulated interest.
For traditional savings accounts, this would involve depositing a sum of money for a fixed period and getting an interest rate for that period. Unfortunately, due to Federal Reserve’s monetary policies that discourage savings, such banking accounts yield up to 1.58% APY, in the best-case scenario. This may increase further if the Fed decided it is needed to combat inflation.
Certificate of Deposit (CD) yields have been consistently dropping as the Fed’s money supply and national debt increased. Source: BankRate.com
In other words, we have gotten to the point where low-yield APY savings accounts are not only normalized but are considered high yields.
This is in stark contrast with a new breed of finance based on blockchain networks and smart contracts. In the last two years, this new Finance 2.0 exploded, going from under $1B to over $82B locked in smart contracts across various categories.
Source: The Block
Ethereum is by far the largest blockchain network that spearheaded DeFi, with $45B worth of crypto assets locked in its smart contracts. Because crypto assets are not attached to the central banking manipulation system, DeFi smart contracts that recreate financial services in a decentralized manner offer dramatically higher APY yields.
APY yields of various platforms. Source: DeFiRate.com
Whether Uniswap, Aave, or Compound, APY yields in DeFi rarely go under 2%. This is already three times over the national savings bank account average. However, not all DeFi yield farming is the same.
Of course, there are always risks, and there is no better example than what happened with the Terra ecosystem’s Anchor Protocol. The now infamous incident saw Anchor Protocol play a major role, resulting in massive drops in value.
Anchor Protocol offered massive interest rates on UST deposits — nearly 20% annually. Without getting into too much detail, the setup of that stablecoin deposit resulted in the LUNA token spiking massively in a very short space of time. But things really took a turn for the worse when massive UST liquidations began taking place, which led to even more panic and selling, and consequently the depegging of UST.
As UST was being withdrawn en masse on Anchor, Anchor Protocol’s own ANC token began to crash as users began to exit the platform. Eventually, many Terra users were just left holding their bags. The lesson here is that simply because something has attractive returns, doesn’t necessarily make it good.
Types of Yield Farming
In traditional banking, there is nothing much to consider except to deposit money and get an interest rate. Then, it is up to the bank to decide how to make use of those funds for their suite of financial products.
In DeFi, there are no financial institutions. They have been replaced by smart contracts stored on blockchain networks, and there is a wide range of yield farming opportunities:
Staking: Smart contract blockchain networks, such as Ethereum, Cardano, Algorand, Solana, Fantom, and Avalanche, use proof-of-stake (PoS) consensus algorithms to secure and verify their respective networks.
Each validator running a PoS node (a computer holding the entire blockchain record) uses staked crypto funds for transaction validation. Consequently, when traders use the blockchain, validators get a cut, which is a form of yield farming.
Providing liquidity: If one wants to exchange token A for token B, such as ETH for USDT, a liquidity provider would lock in their funds for either side of that trading token pair. For example, one could go to Uniswap and add USDT to a liquidity pool. Like tokens themselves, liquidity pools are smart contracts but serve the function of banking vaults. Therefore, when someone wants to swap tokens, they would tap into such a liquidity pool, giving liquidity providers (LPs) a yield farming income.
ETH/USDT pair on Uniswap: Uniswap
Lending and borrowing: Liquidity providers can lock-in their crypto funds into pools for other traders who want to borrow instead of swap tokens. Aave, Maker, Compound, InstaDapp, dYdX, and SushiSwap are just some of the DeFi protocols that offer yield farming income to lenders.
It is common for yield farmers to be both borrowers and lenders. This is popular because one could yield-farm with borrowed coins, counting on volatile assets to appreciate offsetting the borrowing cost.
For this reason, the bulk of borrowed assets consists of stablecoins (up to 90%), while the collateral usually consists of volatile cryptocurrencies (up to 75%).
Source: IMF: Global Financial Stability Report (April 2022)
Therefore, yield farmers who borrow and lend would get to keep initial deposits.
Of course, if the volatile asset drops in value, the holders would have to liquidate. Stablecoins generally produce the highest APY yields because supplies are low and demand is high. , In fact, to gain the upper hand on the current rate of inflation, one would have to go higher for profitable yield farming. That’s because the inflation rate denotes the amount of value the dollar lost over one year. For instance, if the cost of a computer monitor was $300 a year ago, one would now have to pay up to $25 more for the same monitor. Why? Because of inflation.
Imagine what the effect would be if a developer decides to pump that much into some altcoin. The same principles of supply and demand apply.