Yields in DeFi

0xcontrib
3 min readMar 30, 2022
Creativa Images/Shutterstock.com

In this post, we will cover the concept of yield farming, the different sources of yields in DeFi and the various risks associated with yield farming.

What is yield farming?

Yield farming is a DeFi activity that allows users to earn yield through various DeFi apps and protocols. If a user has idle assets available, the user can provide those assets for liquidity on such protocols and farm yield. For example — in the case of Uniswap, a decentralized exchange, Liquidity Providers (LPs) can add 50/50 allocations of any two assets that they own in a pool and farm yield on them. Traders on Uniswap then use the pool to trade and LPs earn fees proportional to however much they own of the pool, with trading fees set at 0.3% or 1%. The advantage of yield farming is that the user can put idle assets to work but it comes with a risk of impermanent loss. Impermanent loss happens when one of the two assets provided for liquidity move quite a lot in any one direction.

Sources of yields in DeFi

There are three main sources of yields in DeFi:

  • Lending income: When users lock their assets into a smart contract of a lending and borrowing protocol such as Compound or Aave they earn yield for lending their assets. Borrowers who borrow assets from such protocols pay an interest to the protocol, a portion of which is then paid to the lenders. Lending and borrowing on-chain as explained in one of my previous posts is governed by smart contracts and uses liquidation mechanisms in case the borrower is unable to pay back the loan with interest. .
  • Automated Market Makers’ Trading Fees: Automated Market Makers (AMMs) are the most popular form of decentralized exchanges for DeFi. An AMM relies on participants to create a liquidity pool in order to facilitate the exchange of assets. Traders who use liquidity pools to exchange assets pay fees to LPs for enabling the exchange of assets. Automated market making is performed through a mathematical formula programmed into the smart contract. The most common way of doing this is through the constant product formula. Common AMMs include Uniswap and Curve.
 Quantity of Asset A * Quantity of Asset B = Constant K.
  • Protocol incentives: Incentives for providing liquidity are often available in crypto markets and many protocols offer incentives in the form of native tokens or governance tokens for providing liquidity. These tokens can sometimes be again locked into various yield farms to generate yield in the form of same token or a different token. Compound, for example, rewards liquidity providers with its governance token COMP. Then, there are also pools for COMP available on several other protocols.

Risks associated with yield farming

The two most important risks associated with yield farming are smart contract bugs and impermanent loss. There have been numerous cases of smart contracts getting hacked or being buggy which have resulted in the loss of funds for the users who deposited their assets in the smart contract. By providing liquidity, users also take on the risk of impermanent loss as mentioned in the beginning of this post. We will cover more on the impermanent loss and functioning of AMMs in one of our upcoming posts.

--

--

0xcontrib

Thoughts on mostly crypto, finance, and philosophy.