Levered Yield Farming

“Just get a bigger hoe” - The old farmer replied, slightly confused.

Farming is hard at the beginning.
Farming is hard at the beginning.

Just a heads up: This post is just for education, and this post is not financial nor farming advice. This post assumes you have done some farming before. There are also data tables involved, if that scares you, do not worry. I’ve add some colours, just focus on the visual pattern of the colours inside the tables.

My goal for this post (and hopefully a future series) is to try to use some toy models, assumptions, common sense, and logic to develop a better understanding of the crypto market. I may be wrong in the assumptions I make and the conclusions I draw.

For further reading, The Defiant has well-written articles on levered yield farming: Levered yield farming explained and Levered yield farming strategies.

Yield farming

Just so we are using the same definitions, yield farming refers to depositing your assets with a protocol, which rewards you with a token, which is our yield.

We will be focusing on yield farming as a liquidity provider (LP) for a 2-token AMM, because the LP positions have a few useful properties that we can use to our advantage. There are also yield farm strategies through borrowing/lending platforms, multi-token AMMs, and token staking rewards on various platforms, which we won’t focus on here.

What is Levered Yield Farming?

Levered (or leveraged) yield farming is when you LP with borrowed capital in addition to your own capital. I might use the terms levered yield farming and levered LP-ing throughout. The upside is that we will earn more rewards, and the downside is we take on more risk (more on this later). Many platforms exist for levered yield farming! Here are a few off the top of my head: Alpha Homora, Alpaca, Francium, Tulip.

Toy example

Let’s use a toy example for illustration. Let’s strip away any transaction fees, yield, and borrowing rates for now, and just focus on the value of the LP position.

In these examples, we always start $1000 USDC, and we want to LP in a 50:50 ETH/USDC pool. Normally, when we LP, we swap half into ETH and deposit $500 of ETH and $500 of USDC into the pool.

In a levered yield farming protocol, we are allowed to borrow money. Table 1 below shows some common leverage values and how much money we are borrowing in dollar terms.

Table 1. Initial, borrowed, and total amount under various leverage levels.
Table 1. Initial, borrowed, and total amount under various leverage levels.

To understand leverage and debt, let’s look at 2x leverage column. In this case we have our initial amount of $1000, and the farming protocol lends us another $1000, and now we have $2000. We swap half into ETH and deposit $1000 of ETH and $1000 of USDC into the pool.

If we want to exit the pool now, we must return the $1000 that the protocol lent to us. If the value of my LP position falls to $1000, the protocol will liquidate me, sell everything back to USDC, and take back its $1000. I would be left with nothing.

This is the first risk and the most dangerous risk of levered LP-ing:

the risk of being liquidated when the price of ETH drops.

What happens when ETH falls in price

Our LP position will be worth less and less when ETH falls in prices, until at some point we hit the liquidation level. The following table shows us what our total LP position is worth, depending on our leverage level and ETH price decrease.

Where the cells are green, it means we will not be liquidated. Where the cells are orange, it means we are approaching liquidation. Where the cells are red, it means we are liquidated.

Table 2. LP position value when ETH price is going down
Table 2. LP position value when ETH price is going down

Observation: The liquidation level for 2x leverage is not at 50% ETH drawdown, as one might naively expect. In fact, ETH has to go down 75% for this position to hit liquidation level.

Observation: On low leverage values of 1.1x and 1.25x, the liquidation levels won’t be hit until ETH has a drawdown of >99% and >95%, respectively. To me, this is fairly impressive!

Observation: Even on the higher leverage side of 3x, the liquidation levels won’t be hit until ETH has a drawdown of >55%. This is still a quite generous safety buffer.

Insight: “ETH/USDC LP acts like a 0.5x long on ETH”

The reasoning behind the analogy is that the LP value experiences roughly half the volatility as ETH, since only the LP has 50% exposure to ETH.

We are half-way through the farm fields now.
We are half-way through the farm fields now.

What happens when ETH rise in price

Now let’s examine the second risk, impermanent loss, when ETH price continues rising.

But first, let us clarify a few things about impermanent loss.

Impermanent loss needs a reference to be measured against.

For example, if we are LP-ing $1000 in a 50/50 ETH/USDC pool, the following are all valid reference points:

  1. Holding all $1000 in USDC (tells us how we are doing in PnL terms)
  2. Holding all $1000 in ETH (tells us the opportunity cost of not going all-in on ETH)
  3. Holding $500 in ETH and $500 in USDC (tells us how our LP strategy compares to not doing LP)

We are going to use definition number 3, as we are mostly interested in measuring how much we can optimize the LP strategy. Let’s call definition 3 the “HODL reference”.

We need several tables to keep track of things under different conditions, so brace yourself!

Table 3 below shows the overall value of our LP position, depending on leverage levels and on ETH price increases.

Table 3. LP position value when ETH price is going up
Table 3. LP position value when ETH price is going up

Next, we can see how much value our LP is worth once we repaid our debt. So we do Table 3 minus Table 1, and we get Table 4 below.

Table 4. LP position value if we closed the position and returned all debt
Table 4. LP position value if we closed the position and returned all debt

Next, we need our HODL reference for calculating impermanent loss. This reference value is what we would have if we just HODLed the initial $500 in ETH and $500 in USDC.

Table 5. HODL reference
Table 5. HODL reference

Now, for the grand finale, we are going to see how our levered LP strategies compare to the HODL reference. Take Table 4 divided by Table 5, and we get Table 6 below.

Table 6. Relative performance of Leveraged LP strategy vs HODL reference
Table 6. Relative performance of Leveraged LP strategy vs HODL reference

Looking just at the 1x leverage column, we can see that as ETH prices go higher, we are capturing less and less of the upside compared to HODL. If ETH does a 10,000% gain (100x), our relative performance is just under 20%, so impermanent loss is ~80%. This is definitely not ideal.

Now, if I may direct our attention to the red and green patches in Table 6. Red colours are values under 1, representing an under-performance compared to HODL reference. Green colours are values over 1, representing an over-performance compared to HODL.

“Over-performed” HODL? Did we beat impermanent loss?

Short answer is “Yes”, long answer is “Yes, up to a point”.

The reason why we outperformed HODL was that we borrowed money to buy more ETH. This increases our exposure to ETH beyond just HODL.

But if ETH prices keep going up, the LP keeps trading ETH for USDC. This would reduce our ETH exposure until it is less than HODL, and we would encounter impermanent loss again at some point.

Practically speaking though, if we look at the 3x leverage column, it is telling us:

Even if ETH did a 1000% (10x) gain, we are still beating HODL.

Which I think is simply splendid.

What about impermanent loss when ETH price goes down?

When ETH price is falling, the biggest risk is being liquidated, because then you would be left with nothing. Also, impermanent loss is not realized until I close the position and convert back to USDC. If I am longterm bullish on ETH, I would just keep the position open until ETH is back up again.

What about the trading fees, token rewards, and borrowing fees?

These are all variables that vary widely depending on your pool and market conditions. I’ve removed these from our example to make things simple, but also to examine the most conservative case in which we do not receive any rewards. That being said, in the vast majority of pools I’ve seen have APYs in the 3-4 digit range (net APY = trading fee + token reward - borrowing fees), and they work in our favour by increasing our LP size over time.

What does this mean for the average DEX user?

You will experience lower slippage, as leveraged yield farmers increase the liquidity on DEXes. Otherwise, it’s not very noticeable.

What does this mean for traders?

LP-ing allows us to express our market views, just as we can with options and futures. I don’t speak Greek, so I can’t say much about options. But if I did, it would be something along the lines of “just as options can be combined to create synthetic positions, levered LP positions can be combined to mimic options”.

Comparing LP-ing to perpetuals, I personally think LP-ing is much better suited to longer time frames. LP leverage starts at 0.5x by default and usually has a lower maximum leverage. On perpetuals, leverage routinely exceeds 10x or 20x, and much more suitable for short time frame traders.

Insight: With leveraged LPs, we have very high capital efficiency, we earn boosted trading fees and boosted farming rewards. If we can express our market outlook through a levered LP strategy, we should collect a much higher yield than through an options or perpetuals strategy.

Insight: With leveraged LPs, we always have capital to buy the dip. As long as leverage was not turned to max, when a dip comes, there is the option to borrow money through increasing leverage to buy the dip. *sluuurp*

Insight: We don’t ever need to close the position completely. We can think of the leverage as the accelerator pedal in a car. When you are more bullish, increase leverage, and when less bullish, decrease leverage. With this, we can achieve fine control over how we express our market outlook.

What does this mean for yield farm strategists

Insight: A simple strategy to boost yield with leverage while minimizing liquidation risk, is for every dollar you borrow, to put a dollar into a stablecoin yield strategy, such as Anchor Protocol or Curve3pool. When your levered positions are near liquidation, use the stablecoins you set aside to reduce leverage and avoid liquidation.

We’ve walked through one particular example here, which is LP in a volatile/stable pool. More complex strategies can be formed involve borrowing the ETH instead of borrowing the USDC, which in effect is a short on the ETH, if you want to express bearish-ness. You can borrow both ETH and USDC to create a pseudo-delta-neutral position.

A secret, for those who made it to the end

A little known secret, is that this article only contains half the magic. The other half of the magic needs to come from you, dear reader! I just know that we would have a blast when our ideas collide! Come @ me on twitter. Would love to see it!

Subscribe to 0xcarnation
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.