How to yield farm?

How to yield farm?

April 13, 2023
 min read

Yield farming is an umbrella term that describes the act of finding yield in the DeFi space. In this web3 guide, we'll cover what is yield farming and an example.

By Alan

Yield farming is an umbrella term that describes the act of finding yield in the DeFi space. 

As users explore the DeFi space, some will begin to craft strategies to achieve a higher yield on their assets. We call this Yield Farming

In this guide, we’ll cover:

  1. What is yield farming?
  2. What is incentivized liquidity?
  3. What’s an example of yield farming?
  4. What are the risks of yield farming?

What follows is not investment advice.

What is yield farming?

Yield farming doesn’t refer to a specific process but rather the overall idea of seeking out returns through some combination of staking, lending, and borrowing. These strategies give “farmers” additional return. The opportunity for high rewards comes with risks. 

The simplest way to yield farm is by using yield aggregators, such as Yearn, which will do the behind-the-scenes work for you. You can deposit a variety of assets into Yearn and they will use strategies to earn yield passively. 

If you are interested in a more active strategy, you’ll be able to choose your own path to balance risk and reward. DeFi users are not locked into one protocol. This enables users to create a yield strategy across different protocols. We will walk through examples of yield farming strategies, as well as the risks. 

Yield Farming is a more advanced topic within DeFi. Let’s review a few terms:

  • Liquidity Providers (LPs): LPs provide assets to a decentralized exchange (DEX) to enable trading. Check out our guide if this is a new concept for you.
  • Lending and Borrowing: This is similar to lending and borrowing at a traditional bank. In DeFi, it involves depositing collateral (lending) and having the ability to borrow against it. Check out our guide on How to lend and borrow assets?
  • Staking: Staking means locking your tokens up. This can be done to secure a Proof of Stake network. Staking can also be done on the protocol level to incentivize users to hold a token. Our staking guide can be found here

What is incentivized liquidity?

A common type of yield farming is when liquidity providers are incentivized to add liquidity to a platform. Let’s explore a simple example:

Odyssey wants to launch a token $ODY. Users can go to a DEX like Sushiswap and add $ODY and ETH to a liquidity pool. If this is a new token, volatility will likely be high, leading to higher risk. 

If Odyssey can’t increase liquidity, then its token won't be usable in the market. Odyssey wants to offset the risk for LPs and puts up a reward of 100,000 $ODY/day for 20 days. This reward is split between liquidity providers. Initially, if it is only a few providers, they will each get a large reward. 

Savvy yield farmers will see this high return and will add liquidity to get a slice of those rewards. This will increase the liquidity of $ODY. It may not be sustainable, as the rewards are limited. LPs are not locked in, so if they find better rewards elsewhere, they can sell their tokens and move on any time. 

This is referred to as liquidity mining. In addition to protocols offering rewards on certain pools, DEXs can offer rewards in their native token to attract capital to their platform. On SushiSwap, you will see pools paying out rewards of the Sushi token. 

Protocols adding incentives in their native token is not exclusive to DEXs. Lending and borrowing platforms use a similar incentive. Compound pays out their native $COMP token to depositors and borrowers to incentivize users.

These strategies mentioned above are simple versions of yield farming, some folks choose to increase the complexity to achieve a higher return. Let’s see an example.

What is an example?

We will build on the example mentioned in the article: How to lend and borrow assets?

In that example, we deposited 10 DAI on Aave Polygon and borrowed 2.5 MATIC. Instead of simply holding the Matic, let’s see how we can earn additional yield on it. 

1. Add borrowed Matic to SushiSwap Farm

We head to SushiSwap and see a MATIC and ETH farm with an APY of over 14%. The term “farm” means a liquidity pool where you can stake your LP tokens to earn additional rewards. The fields below are TVL, farm rewards, and APY.

The farm rewards column shows additional incentives to staking your LP tokens beyond the trading fees. In this farm, a daily reward of 725.2 Sushi and 12.09 Matic is split between all “farmers” who stake LP tokens. 

First we will swap half of our MATIC tokens (1.25 MATIC) into WETH as seen below.

Then will will take the equal amounts of MATIC and WETH and deposit it into the liquidity pool.

Once we confirm adding liquidity, we will be prompted in our wallet to confirm the transaction and gas fee. We will then recieve SLP, which are the tokens representing our portion of the liquidity pool.

The final step is staking our SLP tokens as seen above. This will enable us to earn the farm rewards of Sushi and MATIC.

In  this yield farming example, we have earned yield in the following ways:

  • Earning yield on our deposit of 10 Dai in Aave
  • Providing liquidity and earning trading fees of the pool with Matic and Ether
  • Earning farming rewards from staking our LP tokens 

Our costs for this example are:

  • Interest on the borrowed Matic tokens in Aave
  • Gas fees for entering transactions and gas fees when we unwind any transactions. 

This example shows the portability in DeFi. We can use multiple protocols and tokens to find additional yield, but it is not without risk.

The more protocols and smart contracts you interact with, the more risk you take on.

What are the risks?

Yield farming risks include:

  • Smart-Contract Risk: cyber attacks and technology failures, especially prevalent in unaudited code
  • Impermanent loss: losses incurred with price volatility in a liquidity pool
  • Borrower liquidation: if collateral value falls below a certain threshold while borrowing, there is the risk of liquidation of collateral. Leverage increases risk.
  • High transaction fees:  Gas costs eat away at yield, especially if multiple transactions are involved. This is most prevalent on Ethereum mainnet 

Yield farming is a delicate act of balancing risk versus return on your capital. It is important to understand the risks associated with advanced strategies and leverage. Proceed carefully!

Up next: How to avoid getting rekt in DeFi?

Learn more

Subscribe to our newsletter
Oops! Something went wrong.
On this page

What is yield farming?

What is incentivized liquidity?

What is an example?

What are the risks?

Learn more

Related articles

Browse all

Prev Article


There are no previous articles in this Pathway

Check out other Learning Paths!

Next Article


There are no more articles in this Pathway

Check out other Learning Paths!