Crypto Trove

How to Yield Farm In DeFi ( step-by-step )

Yeild farming

You're likely familiar with token farming and staking, popular methods for increasing capital with cryptocurrencies.

Now, it's time to explore yield farming, another lucrative opportunity in the fast-paced world of Decentralized Finance (DeFi). 

This guide will introduce you to yield farming and show you how to profit from it. For instance, you can deposit your crypto assets into a liquidity pool on platforms like Uniswap or Curve to earn rewards.

Table of Contents

What is yield farming?

Yield farming is an investment strategy where you stake or lend your cryptocurrencies on a DeFi platform to earn higher profits.

The concept is similar to planting seeds: you "sow" your crypto assets in a place that offers the most benefit and "harvest" the returns at the right time.

Think of it like traditional bank deposits, but instead of relying on banks, yield farming uses DeFi protocols. For example, you might deposit your crypto into a platform like Aave or Compound and earn interest in return.

How does yield farming work?

To begin yield farming, you need to become a liquidity provider by lending your funds to a chosen project. Before diving in, it's crucial to understand the process.

  1. Automated Market Makers (AMMs): These are the main tools of yield farming. AMMs are like marketplaces where you can lend or trade your cryptocurrency, with smart contracts automatically setting asset prices. For example, Uniswap is a popular AMM that facilitates these transactions.


  1. Liquidity Pools: These are where your funds go. By depositing money into a liquidity pool, you help maintain market operations. A well-known platform utilizing liquidity pools is Curve Finance.


  1. Decentralized Exchanges (DEXs): Once your funds are in a liquidity pool, others can borrow or trade them on a DEX linked to that pool. For instance, on SushiSwap, users trade assets from these pools.


  1. Earning Rewards: DEXs charge fees for transactions, which are distributed among all liquidity providers. Your reward depends on the amount of liquidity you contribute. The more you invest in the pool, the larger your share of the fees. For example, if you provide a significant amount of liquidity on PancakeSwap, you earn a proportional share of the transaction fees collected.

Following these steps, you can effectively participate in yield farming and earn rewards based on your contributions.

Also read Common Pitfalls To Avoid As a Beginner Trader In Crypto

Yield farming in two steps

To implement this yield farming strategy, follow these steps:

  1. Acquire Liquidity Pool (LP) Tokens: First, you need to provide liquidity to a pool on a platform like Uniswap or PancakeSwap. In return, you'll receive LP tokens representing your share in the pool.
  2. Deposit LP Tokens into the Farm: Next, deposit these LP tokens into a yield farming pool, such as those found on SushiSwap or Harvest Finance, to start earning rewards.

By completing these steps, you can effectively participate in yield farming and generate returns.

Also read How to Make Money with DeFi: A Guide for Beginners

What you need to yield farm on a decentralized exchange

To start yield farming on a DEX, you'll need four essentials:

  1. Digital Wallet: This is where you'll store your cryptocurrencies and digital assets. Opt for a self-custodial wallet like the Wallet app, which gives you full control over your assets, unlike custodial wallets managed by third parties.


  1. Cryptocurrency: Your wallet must hold cryptocurrency to cover transaction fees, which are necessary for any blockchain actions. For instance, on the Ethereum blockchain, you'll need ETH to pay these fees.


  1. LP Tokens: To participate in yield farming, you'll need liquidity pool (LP) tokens. Obtain these by depositing equal amounts of two cryptocurrencies into a liquidity pool on the DEX.


  1. Decentralized Exchange (DEX): Choose a reputable DEX with plenty of liquid markets, third-party security audits, and attractive, sustainable farming rewards. For example, platforms like Uniswap or SushiSwap are well-regarded in the DeFi community.

What are liquidity pool tokens?

Liquidity pool tokens are crucial for decentralized exchanges (DEXs). DEXs rely on users adding liquidity to trading pairs, which allows for smooth trading operations. 

Unlike centralized exchanges, any user can create a trading pair or enhance an existing one by contributing liquidity. To encourage this, DEXs share a portion of their trading fees with liquidity providers.

When you add cryptocurrency to a liquidity pool, a smart contract issues you a liquidity pool (LP) token, which serves as a receipt. This token allows you to claim any earned rewards and withdraw your initial deposit.

Additionally, you can stake your LP tokens in a "farm" to earn extra rewards. This process further boosts your earnings from providing liquidity.

Risks In Yield farming

Yield farming carries inherent risks, with some protocols being more secure than others. Here are some of the most common risks:

  1. Cyber Attacks: When you stake, pool, or lend your assets, they are stored in a smart contract or pool rather than your wallet. Hackers may exploit vulnerabilities to steal these funds. Therefore, only invest what you can afford to lose. For example, in 2020, the DeFi platform bZx was hacked, leading to significant losses for investors.

Also read; What are the core concepts of DeFi Business? Beginner’s Guide( Learning the DeFi Slang)

  1. Rug Pulls: This occurs when a new token offers unrealistically high APY to attract investments into its liquidity pool. The creator, holding a significant portion of the pool, withdraws their funds and sells the tokens, crashing the token's market. An infamous case was the SushiSwap incident, where the creator sold a large amount of tokens, causing panic and a sharp price drop. Always research protocols thoroughly before investing, including checking how much liquidity is locked by the founders.

Also read; How To Do A Good Crypto Research As A Beginner

  1. Scam Tokens: Some tokens or dApps are outright scams, promising high APY or utility to lure investors. Once funds are deposited, the scammers disappear with the money. An example is the DeFi project YAM, which promised high returns but turned out to be a scam. To avoid such pitfalls, thoroughly vet yield farming opportunities to ensure they are legitimate.
  2. Impermanent loss: When you provide liquidity to a platform, it's like investing your money in both the bakery and the coffee shop. Instead of businesses, you’re providing pairs of cryptocurrencies to a liquidity pool. For example, you might provide both Bitcoin (BTC) and Ethereum (ETH) to a DeFi platform. Also read What Is Impermanent Loss In DeFi & How To Avoid It?


    Here’s where impermanent loss comes into play. Imagine that the bakery becomes super popular overnight, and its value doubles. Your initial $50 investment in the bakery is now worth $100. However, the coffee shop didn't do as well and its value stayed the same. If you had just held onto your original $50 investments separately, you'd now have $150 in total ($100 from the bakery and $50 from the coffee shop).

    But, because you invested in a liquidity pool, the platform automatically balances your investments. To keep things simple, let’s say it balances them in such a way that the value of your investment remains equal in both businesses. This means that you don’t fully capture the $100 gain from the bakery because some of that value is redistributed to the less successful coffee shop.

    When you withdraw your money, you might find that you have less than the $150 you would have had if you just kept the investments separate. The difference between what you could have had and what you actually have is known as impermanent loss. It’s “impermanent” because if the values of both investments (or cryptocurrencies) return to their original ratios, the loss disappears. However, if you withdraw your money when the values are imbalanced, the loss becomes permanent. 

Understanding these risks and conducting proper research, you can better protect your investments while yield farming.

What Are Farming Rewards and Where Do They Come from?

Farming rewards on most DEXs are typically paid in the exchange's native token, sourced from its outstanding supply. The DEX operators determine the APY, eligible LP tokens for farming rewards, and the duration of these rewards.

Some DEXs offer extremely high APYs, sometimes exceeding 1000%, to attract liquidity and attention. However, such high rewards are usually unsustainable. If too many tokens are distributed and sold, their value can plummet.

For example, platforms like SushiSwap have experienced this issue, where high APYs initially attracted users but later led to a significant drop in token value once the rewards were claimed and sold off.

Additionally, these high APYs often attract "mercenary liquidity providers" who quickly sell their rewards and withdraw their liquidity once the rewards decrease. This behavior can leave the DEX with insufficient liquidity and devalue its native token.

How Are Rewards Calculated And Distributed?

Farm rewards are distributed to users based on the amount of LP tokens they have deposited and the duration these tokens remain in the farm.

The projected APY is calculated using a model that assumes all liquidity providers in the pool have deposited their LP tokens in the farm for the entire distribution period. If fewer providers participate, those who do will earn a higher APY than projected. Conversely, if more liquidity is added and more LP tokens are staked during the period, the APY will be lower than expected.

For example, on platforms like Uniswap, if only a portion of the liquidity providers stake their LP tokens in the farm, their APY will be higher than the projection. Conversely, if a sudden influx of tokens occurs, the APY will temporarily drop. 

The DEX operators set and can adjust these distribution periods over time to manage rewards effectively.

How-to-farm step 1: Get liquidity pool (LP) tokens

Providing liquidity to a DEX is a simple process. When considering farming, look at the APY of different pools and farms, and identify which LP tokens are accepted. 

  1. Choose a Pool/Farm: First, find a pool with a favorable APY and acceptable LP tokens. For example, if a pool on Uniswap offers a high APY for the ETH/USDC pair, it might be a good choice.


  1. Deposit Assets: Deposit the required cryptocurrencies into the pool. For instance, add equal amounts of ETH and USDC to the chosen pool.


  1. Receive LP Tokens: After depositing, you’ll receive LP tokens representing your share of the pool.


  1. Deposit LP Tokens into the Farm: Finally, deposit these LP tokens into the farm to start earning rewards.

By following these steps, you can efficiently contribute liquidity and begin farming on a DEX.

How-to-farm step 2: Deposit liquidity pool (LP) tokens in a farm

After obtaining the accepted LP tokens, you can deposit them into a farm to begin earning additional rewards. For example, if you have LP tokens from an ETH/DAI pool on SushiSwap, you can stake these tokens in a SushiSwap farm to earn extra incentives.

Is there a lockup period when depositing in farms?

Some DeFi yield farming strategies include lockup periods, while others do not. For instance, Verse Farms allows you to withdraw your LP tokens anytime, with no lockup period.

In contrast, many DeFi protocols mandate that users lock their funds for a specific duration before withdrawal is possible. For example, certain pools on platforms like PancakeSwap may require a 30-day lockup period for LP tokens.

How to claim rewards?

Sometimes you need to withdraw your LP tokens to claim rewards, while other times you can leave your LP tokens in the farm and claim rewards as you wish. For example, on platforms like Uniswap, you might need to withdraw your tokens to access your earnings. Conversely, on SushiSwap, you can often leave your tokens in the farm and claim your rewards at any time.