Earn 100%APY+ from DeFi: Yield Farming and Liquidity Mining Explained

Updated: Sep 23

Decentralized Finance (DeFi) is the type of financial service that is “permissionless & disintermediated” built on blockchain protocols and smart contracts. Anyone can access financial services in a decentralized way, removing unnecessary costs of middlemen (e.g. the banks).


DeFi is said to have brought the second bull market to crypto, just like ICO did in 2017. What’s behind the recent hype in DeFi? This piece is meant to give you basic knowledge (to participate if you so wish) and the risks associated with it.

Thanks to dmitrydao for sharing their work on Unsplash.

It all started with lending

One of the first DeFi protocols is “MarkerDAO” which enables ETH-holders to borrow USD stablecoins (called DAI). Users deposit ETH as collateral, and generate DAI stablecoin that can be used for trading, lending, or buy other crypto assets. The amount of DAI generated is proportionate to the collateral and is currently set at 150%, meaning that borrowers who deposit $150 worth of ETH can take out $100 worth of DAI. As a DAI holder, you have options to 1) convert DAI to buy more ETH if you believe ETH price will go higher and want to get more price exposure; 2) sell ETH if you believe ETH price will go drop temporarily and want to short without having sold the actual ETH; 3) lend DAI to someone else so you earn more yield.

In a traditional market, anyone with excess cash has a choice to park those cash in a money market which is a market for short-term debt. In crypto, such a market is called Compound Finance.


Instead of matching individual borrowers and lenders, Compound acts as a bank matching a pool of deposits with a pool of loans. It aggregates tokens into Liquidity Pools (pools of deposits). If you want to lend, instead of having to sift through borrowers to find the one whose needs match what you have, you can simply add your tokens to the liquidity pool. On the other hand, borrowers can choose whatever tokens they want and withdraw from the pool anytime without having to be matched with the right lender. The liquidity pool is decentralized because it’s a series of smart contracts that automatically match borrowers to available assets and shuffle interest payments from borrowers to lenders. The interest rate is calculated algorithmically based on the supply & demand of each token. To date, Compound has over $1.5B in token supply and $838M in loans[1].

With Compound, a lender can make a decent lending rate at 0-3%+ APY. That’s much higher than today’s bank deposit rate (0.5% in Thailand). But, the reason the market has recently gone crazy for DeFi is that users can get “additional yield” on top of the lending rate.


How? First, we need to understand what users get when they engage with Compound.

  • A lender gets ‘cToken’: As a lender, you will add the tokens that you wish to lend into Compound. In return, you will get cToken, a synthetic token generated to represent the tokens you have deposited. Once you want to redeem your original token (close out your position), you simply deposit cToken back to the pool and you will get your original token back. For example, if you want to lend 100 DAI, you deposit 100 DAI into Compound and you will get a cToken that can represent 100 DAI in which you can use to redeem your original 100 DAI at a future date.

  • Both lenders and borrowers get ‘COMP token’: In contrast to a typical bank where the management team decides how to operate the business, Compound is a decentralized entity where the token holders have the right to vote and govern the protocol. In June 2020, Compound started to distribute its COMP token as a reward to users with an aim to incentivize the users to engage with the protocol’s governance. You can simply lend or borrow on Compound to get the COMP token. So yes, you can make money even from borrowing money.


This is when things get interesting as users can get an additional return on top of the lending rate if the COMP token appreciates. In fact, COMP token has skyrocketed to a peak of $336 late June 2020. Additionally, lenders who get cToken can also deposit that cToken in other DeFi protocols to earn additional yield.


Now, you might wonder why on earth would any DeFi protocols pay interest on cToken. We need to understand another player in the ecosystem, the DEX.


DEX

Most crypto trading happens on centralized exchanges (CEX), e.g. Binance, Bitkub. CEX is “custodial” in nature as the exchange has full control of the user’s assets, making CEX a honey pot for hacks. In contrast, a decentralized exchange (DEX) uses a set of smart contracts to automate the selling/buying of crypto assets without holding the actual asset (“non-custodial”) and represents a more secure option for trading.


However, DEX is often criticized for not having enough liquidity. Liquidity refers to the ease at which an asset is converted into cash without affecting the price of said asset. In a liquid market, assets can be easily converted into cash with minimal slippage. But, because there’s limited liquidity on DEX, trading is more costly (large spread or price slippage) and slower than CEX.


Decentralized exchanges can be divided into 2 types:

  • Orderbook Exchange uses a bid/ask system to match the buy/sell order at a chosen price. This method is optimal for exchanges with high trading volumes (e.g. CEX) because high liquidity leads to a tight spread. Therefore, traders can place large orders with minimal slippage. However, this model does not work well with DeFi tokens (e.g. cToken) as the tokens are not actively traded and there are not enough buyers and sellers in the market. Another issue with a decentralized orderbook is front-running. An example of an orderbook exchange is 0x.

  • Automated Market Makers (AMM) allows the token holders to swap tokens with a liquidity pool directly without requiring a counterparty to the transaction. The trader’s order is not directly matched with another trader’s order. Instead, Orders are executed instantly with the liquidity pool. For example, you can swap token A for token B by depositing token A into the liquidity pool and get token B directly from the pool. A small fee is charged from the user and is distributed to the liquidity providers (LP) who provide liquidity to that pool. Examples of AMMs are Uniswap, Balancer, Curve Finance.

Illustration

Now combining the lending protocol (MakerDAO & Compound) and DEX together, one can invest in the following strategy:

Investment Strategy Illustration
Investment Strategy Illustration

*A Liquidity Provider token (LP token), similar to Compound’s cToken, is a synthetic token that can be used to redeem the original token you had deposited. This type of token is generally called a Liquidity Provider token (LP token).

**CRV tokens are Curve Finance’s governance tokens, similar to Compound’s COMP tokens.


If a user engages only with MakerDAO & Compound, the total yield would be 3.03% APY from Compound - 0.5% cost of borrowing DAI.


By adding DEX into the picture, the total yield would be:

- 0.5% cost of borrowing DAI

+ 3.03% APY from Compound

+ 9.76% APY from Curve

+ COMP tokens

+ 35%-87% from CRV tokens

From the diagram below, one can expect to earn 34.66% to 86.65% as a reward in the form of CRV governance token. At the time of writing, COMP token is worth $151, CRV token is worth $1.51. So you’ll see that a majority of return is actually from the governance token rather than the lending yield or liquidity provider’s fee.

This transaction can be broken down into 2 parts: yield farming & liquidity mining.

Yield Farming

Yield farming is the act of seeking the best return from parking crypto assets (either from interest or transaction fee). A yield farmer might move assets around (e.g. within Compound), constantly chasing whichever pool is offering the best APY from week to week or leverage multiple DeFi protocols to do so.


Liquidity Mining

The process of providing liquidity to DEX and staking LP tokens in order to get a governance token is called “Liquidity Mining.” It’s a community-based, data-driven approach to market-making, in which a token issuer or exchange can reward a pool of miners to provide liquidity for a specified token. For liquidity pools to work, a large number of tokens need to be stored in the smart contracts. In addition to the yield from providing liquidity, some DEX also offers governance tokens to LP as a sweetener for providing liquidity on their protocol. When a yield farmer provides liquidity to a DEX as an Automated Market Maker (AMM), they will get an LP token which represents their stake in that pool. This LP token can be staked into the protocol to get a newly minted governance token.


Similarly, bitcoin miners use their computation power to verify transactions; earn transaction fees + newly minted Bitcoin. Liquidity Providers use their crypto assets to provide liquidity for a DEX; earn transaction fee + newly minted governance tokens.


Final Thoughts

While this represents a lucrative way of putting your crypto assets into work, but there are a few caveats to keep in mind with regards to risks:

  • What is smart contract risk? The level of return is correlated to the riskiness of the underlying smart contracts. Unaudited pools often promise higher returns. Even more established pools, like Balancer, faced smart contract exploitation that drained $500k from its pool.

  • Is the token value coming from real or speculative demand? Since these protocols are generating tokens out of thin air, the value will be accrued to protocols that can retain users and capture the largest liquidity pools in the long-run. The governance token only has value when the protocol has a large user base and active participation of the governance process. Without real demand, the winners are those who mint and sell the tokens fast, the losers are retail investors who buy the tokens on exchanges.

  • Is the governance token considered security? A token becomes security if it fulfills the Howey Test: an investment of money in a common enterprise with a reasonable expectation of profits to be derived from the efforts of others. A governance token - a byproduct of liquidity mining - is a result of investing crypto assets into a DEX with an expectation of profits in the form of transaction fees and tokens. But, one can also argue that the process is similar to Bitcoin, thus, it is not a security.

Thanks to Sanjay Popli @Cryptomind for feedback on this post.

Note:

[1] Data as of 20 Sep 2020 from Compound Markets

[2] The ratio is arbitrary and only for illustrative purposes.


Sources:

DEXs Ride the DeFi Wave: Liquidity, Security and the Road to Mass Adoption

What Is Yield Farming? The Rocket Fuel of DeFi, Explained


Photo by dmitrydao on Unsplash

 

©2020 by Nattariya