What Is Yield Farming?

Yield farming is a DeFi investment strategy that allows you to "stake" or lend your crypto assets and receive rewards. These rewards can come as a percentage of transaction fees, interest from lenders, or liquidity provider tokens (LP tokens). Yield farmers always hunt for the highest returns by moving assets between yield investment strategies in search of more profitable protocols.

Summary of Important Points

  • Yield farming is an investment strategy that entails the staking of equivalent asset pairings in a liquidity pool of a DeFi protocol.
  • Yield farmers are also called liquidity providers and earn rewards in transaction fees or liquidity provider tokens.
  • Yield farming profitability is calculated via APR and APY.
  • APR formula: Annual Return/Investment * 100
  • APY formula: Invested Amount * {(1+r)^n-1}
  • The risks of yield farming may include impermanent loss, faulty smart contracts, and whale manipulation.

How Does Yield Farming Work?

DeFi platforms rely on a basket of funds run by smart contracts known as a liquidity pool. The liquidity pool is necessary for the proper functioning of the DeFi ecosystem. It is crowdfunded and open to participation by any willing investor. Those who invest in liquidity pools are called liquidity providers (LPs), and this process forms the basis of yield farming.

Yield farmers are liquidity providers that have locked up their tokens in a DeFi protocol's liquidity pool. They do this by adding liquidity in equivalent value pairs. For instance, you can farm yields on an asset pair of Ethereum /USDT by contributing liquidity of equal value in Ethereum and USDT.

The liquidity pool allows the DeFi platform to deploy a marketplace for trading and lending cryptocurrencies. The transaction fees generated by this marketplace are used to pay investors that contributed to the liquidity pool. Yield farmers may also get liquidity provider tokens (or LP tokens) which have their own utility and may provide some advantages for holders.

How to Calculate Yield Farming Profitability

The primary parameters used to calculate profitability in yield farming are Annual Percentage Rate (APR) and Annual Percentage Yield (APY).

Annual Percentage Rate (APR)

This describes, in percentage, the total investment earned in a year. To calculate APR, use the following formula: (Annual Return/Investment) X 100

Example:

If the APR for the token SUSHI is 30% and you stake $500 of SUSHI into a Sushiswap yield farming pool, you will earn 30% of $500 = $150. Your total investment at the end of the year will be $500 + $150 = $650

Annual Percentage Yield (APY)

This is the total amount of daily compounding interest earned annually. To calculate APY, use the following formula: (Invested Amount) X {(1+r)^n-1}

Where r = daily compounding rate n = time

Using the previous SUSHI example: r = 30% = 0.3 yearly. Therefore, daily rate = 0.3/365 = 0.000821 n = 365 days

Using the formula: $500 X {(1 + 0.000821)^365-1} $500 X {(1.000821)^365-1} $500 X (0.34924) = $174.62

The total compounding return at the end of the year will be $500 + $174.62 = $674.62

Risks of Yield Farming

Yield farming has tremendous profitability, but this DeFi investment strategy comes with risks of its own, such as the following:

Impermanent Loss

Yield farmers contribute liquidity to a pool in equal value pairings of cryptos. If investors intend to farm yields on an ETH/USDT pool, they must contribute an equivalent portion of Ethereum and USDT. For instance, 100 USDT contributed will require $100 worth of Ethereum.

The liquidity pool smart contracts always try to balance out these pairings (in dollar value). Therefore, if the price of one of the asset pairings drastically changes, an impermanent loss may occur, meaning the investor will get less value (in dollars) than what they originally put in the pool.

Trading fee rewards and LP tokens may help counter the risk of impermanent loss, but sometimes it is not sufficient. Some DeFi protocols offer investors stablecoin or wrapped token pools to counteract the market volatility and mitigate the possibility of the impermanent loss risk.

Smart Contract Risks

Yield farming runs on smart contracts, and bugs within the code can tank the price of a token and lead to impermanent loss. Bad actors and hackers may exploit security vulnerabilities or loopholes to steal funds in a liquidity pool. DeFi platforms usually undergo several smart contract audits to find and eliminate possible bugs or exploitable vulnerabilities.

Whale Manipulation

The largest contributors to a liquidity pool control the fate of the entire protocol. If these whales sell off a massive portion of their holdings within the pool, it can tank the token price and trigger an impermanent loss across the board, affecting smaller yield farmers.

Posts and articles about Yield farming