What The Hell is Yield Farming?

What The Hell is Yield Farming?


I've discovered not long ago PancakeSwap following @PVMihalache blog and especially this article about a collaboration between Binance and PancakeSwap.
So I gave it a try and earned some CAKE (about $15) until the pool was exhausted.
After that I staked my CAKE in order to farm more CAKE.
So far so good.

Next, as @PVMihalache did, I provided a really small liquidity on HARD-BNB and then staked the HARD-BNP LP tokens in order to farm more CAKE.
That was my first time trying yield farming!
I knew that yield farming could be risky, but I tried with small amounts and as Binance Smart Chain has really small fees this was okay to give it a try. I definitely wouldn't have done the same thing on Uniswap because of expansive Ethereum fees.

This may sound gibberish, so let's dive in some explanations!

Liquidity Pools

Before we talk about yield farming, let's explain what liquidity pools are.

We are familiar with Centralized Exchanges (CEX) like Coinbase, Binance and such.
You need to understand first how the price of a token is computed on a CEX.
This begins with an orderbook: users willing to buy at one price, users willing to sell at another.
Based on this orderbook, you can compute the price as being between the highest price for buy order and the lowest price for a sell order.
Often you can get a gap between those two prices, something called a spread.
For big markets, like BTC/USDT or ETH/USDT, the spread is nearly zero. For other markets this is not always the case.

For Decentralized Exchanges (DEX), like Uniswap for example, they often use something different than an orderbook, called Automated Market Maker (AMM for short).
AMM works really differently than using an orderbook: you provide a pair of tokens (in 50/50 split) in a liquidity pool (LP for short).
For example, you could provide 1 BNB and 43.5 $USDT on PancakeSwap:
a29db62dca5b58d75d5acf064b708007f15e7eaf01d2e0edb91b06ebf2d1493b.pngBy doing so you would be given BNB-USDT LP tokens that represents your share of the liquidity pool.

So why would you do that? Basically you would earn a share of the fees collected from users swapping BNB for USDT (or the other way around).
The amount of fees you would earn is basically your share of the liquidity pools multiplied by the total fees of this liquidity pool.
So the more shares you have the more fees you earn. The more trades are done on this liquidity pools, the more fees there is, hence the more fees you'll earn too.

Impermanent Losses

Now here is the catch though: what happens is BNB rises a lot compared to USDT? You would end up far away from that initial 50/50 split.

Let's assume that BNB rises to 50 $USDT on other exchanges. If no trade were done on the liquidity pool, the price would still be 43.5398 $USDT.
This gives an incentives for traders to buy a cheap BNB from the liquidity pool and sell it elsewhere (something called arbitrage).

This also means that basically the liquidity pool is having more USDT than BNB, hence the same for your share of the pool.
But as the price of BNB rises and you have less BNB than initially, you are basically loosing some gains for the BNB rise.
This is the impermanent loss.

Why is it called impermanent? Simply because until you ask the liquidity pool to give back your assets (BNB & USDT), this loss could change (for example if BNB is dumped).

You can find a nice tutorial explaining impermanent losses in depth on this tutorial:

Let's see a real example from my HARD-BNP share:
6ca034c5947e296892d1dd4ab45ee6238e5f9dbb2760138c204a9afcb88c7eb0.pngI have here a rather big price change (HARD went down while BNB went up) of -47.76%.
Due to that, I may loose (remember impermanent losses) 0.01 BNB.
Meanwhile I made a gain from the fees of 0.01 BNB, so my net profits are zero so far :)

So the more stable a token is compared to another in a liquidity pool, the less likely you would be hit by impermanent losses.

Yield Farming

My previous example on HARD-BNB may not be a good incentive for providing liquidity in pools, but remember that not all liquidity pools would end up having such a big price change.

Moreover, with PancakeSwap we can do another thing: we can stake our HARD-BNB LP tokens in order to farm some CAKE:
ac4e1fd44d55cdfd85a8aeee23dd278bf4dc6c9c095efe5f1eb7a1583631b4e8.pngAs you can see the APY is rather interesting (and fluctuating): I earn right now 138.10% APY in CAKE.

Let's review what this means over a few weeks of providing this liquidity and farming CAKE:
436f88e1e5f617005398a3b8344a68ca7e83d3e82472cf435a9e5b693dc3e127.pngI made a profit of 0.80 CAKE with current CAKE price at $0.652, so $0.5216 from the initial investment of $1.97, nearly 26.48% over a few weeks!
Okay, I'm not taking into account the Binance Smart Chain fees, but they are really low (about $0.10 when I did this).

Monitoring your impermanent losses is really important and there is a really good site for this: https://yieldwatch.net

I will probably give a try to CAKE-BNB liquidity pool with a few hundred dollars worth of CAKE and BNB and talk later on about another great tool, that is Beefy.

Hardware Wallet Peregrinations
Hardware Wallet Peregrinations

I will discuss anything related to the use of a hardware wallet (ledger) for multiple things like staking and DEX.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.