Leveraging and Borrowing Strategies for Uniswap LPs Using YLDR

Atis E
9 min readFeb 23, 2024

--

YLDR is an Aave fork that allows to leverage Uniswap v3 positions and to borrow against them. This article looks at the implications for liquidity providers (LPs).

Introduction

Some argue that there are two types of LPs:

How does YLDR cater for these two types? For more passive LPs, it allows to borrow funds against their positions, or to lend their ERC20 tokens using Aave-like interface. For the more active ones, it allows to leverage their positions to earn extra yield.

For a passive strategy, the assets in a liquidity pool represent a stable source of income, similar to staking. However, there are a number of differences between stakers and passive LPs. For one, ETH and other PoS coins have liquid staking derivatives (LSD) like stETH. These LSDs can be used in DeFi on their own, while the principal asset is not touched. This is not the case for liquidity positions, which typically don’t have any use of their own. Using the position as collateral on YLDR or a similar protocol allows one to keep earning fees while also enabling the borrowing of more liquid assets at the same time.

On a different note, research has repeatedly shown that using borrowed assets to LP allows to effectively hedge against asset price changes. Why? Because liquidity providing using one’s own assets, without hedging, is essentially a bullish strategy. It relies on the assumption that the price of the assets in the position doesn’t decrease significantly. This assumption is not true: most coins bleed against ETH in the long term, and the long-term outlook for most ETH/X pairs is negative. Borrowing some part of the assets to be put in the liquidity pool allows the LP to express more nuanced views on the future price expectations, and to implement bearish or delta-neutral strategies.

However, using an external lending protocol to borrow is not capital efficient. YLDR offers the option to leverage the position itself, using the assets in the position as collateral. At the core, the protocol expects the user to open a v3 position and specify the leverage factor. It then uses a flash loan to borrow one of the assets from the protocol, swapping to achieve the correct proportion of assets if required, and deploying the increased liquidity into the user’s position. (Technically, the borrowed asset is not even required to be one of the two assets that make up the position, however, for this article I’m only going to consider it to be token0 or token1 from the position.)

YLDR is a fork of Aave and represent a relatively simple approach to derivative financial product built on top of concentrated liquidity. For instance, at the heart of the Panoptic protocol are their novel product of perpetual DeFi options. Panoptic is going to have three types of user roles: liquidity providers, option sellers, and option buyers. YLDR provides alternatives to two of them:

  • Leveraged positions in YLDR are most similar to option sellers — essentially, both put undercollateralized liquidity in Uni v3 pools.
  • The users who lend their positions to YLDR are most similar to Panoptic’s liquidity providers.

While the functionality of YLDR is more limited (for instance, it does not cater for the option buyers), it benefits from the fact that DeFi users have much better understand of lending and borrowing as financial instruments, compared with options strategies.

Borrowing against v3 positions

A v3 position can be deposited on the YLDR’s lending market. The screenshot shows a full range ETH/USDT position. The position is automatically used as a collateral, and now it’s possible to borrow against the value of the position.

The maximal loan-to-value (LTV) threshold is set by the protocol configuration. It can be quite high, such as 70%, similar to ETH itself or even higher. An external price oracle is used to determine the value of the assets in the position. It’s not practical to attack the protocol by manipulating the price in the Uniswap pool where the position is deployed. The value of the position as used by the protocol (i.e. the effective value) is not affected by such a price manipulation, only the real value of it’s assets is affected.

Technical side note: the latter would be a big issue if the real value of the position could be reduced below its effective value; however, by manipulating the price in the Uniswap pool, the position can only be made more valuable, not less! This is because the further assets are deployed from the current price in a Uniswap pool, the higher buying power (i.e. potential value) these assets have — see the figure below! Changing the price in a pool requires that token0 is converted to token1 (or vice versa). The further away from the starting price the manipulation gets, the higher amount of assets is required to keep the conversion going, assuming uniform depth of liquidity in the pool.

Manipulation of the pool price can only increase the position’s value

Position lenders on YLDR do not directly earn interest from the users leveraging their positions. If you’d like to that, it’s possible, but requires a few extra steps. After borrowing ERC20 tokens against your position, you can now put their value back in the protocol and earn APR from that. Obviously, looping the same token is not going lead to positive APR unless there are some external incentives. However, it may be different if you swap the borrowed token for something else. For instance, you can borrow ETH, swap that for USDC, and deposit the USDC back to YLDR. There are several rational reasons why someone would want to do this, for example:

  • You have an ETH/stablecoin position and want to be delta-neutral with respect to ETH.
  • The APR for borrowing ETH is much lower than the APR of lending USDC, and you don’t expect large ETH price appreciation in the near term.
  • You just want to short ETH.

Leveraging v3 positions

In DeFi, higher-risk products always attract attention. For the users who are not satisfied even with the concentration levels offered by singe-tick-range positions in Uniswap v3 pools, leveraged positions can be the answer.

Of course, leveraging the position and concentrating the position isn’t always going to have the same effect. Leveraged positions can even be used to reduce risk! For instance, consider a pools where USDC is paired with STABLE, a hypothetical new stablecoin that’s supposed to be dollar-pegged, but that you as an LP do not trust. A good strategy could be to create a smaller USDC/STABLE position and then leverage it by borrowing STABLE against position’s value. Once STABLE depegs, the value of the position will go down, but the value of the loan is also going to go down. A highly concentrated liquidity position would leave you with 100% of STABLE, decrease in value proportional to the depeg, and no more fees earned.
A leveraged, wider range position would keep the drawdown of the position much smaller, and potentially you could even keep earning fees.

Impermanent loss and leveraged v3 positions

The plots below show how the value of the principal capital and the PnL compared with HODL changes when the asset price changes.

Four positions are compared. They are all symmetrical, with the central price P equal to $2000, and the price range equal to [P/(r+1), P·(r+1)].

  • “Normal” position, with range factor r=0.1
  • “Narrow” position, with range factor r=0.02
  • “2x Leveraged” — positions where half of the capital is borrowed, with range factor r=0.1.

The narrower, more concentrated liquidity position has higher impermanent loss (IL) than the normal position. In contrast, for the leveraged positions, the loss is higher in one direction, but the other direction even shows some “impermanent gain”.

Position values under volatile asset price change. Initial position value $4000, initial asset price $2000. Earnings from fees not included
Impermanent loss or gain under volatile asset price change, computed by subtracting 50:50 HODL asset value from the position’s value. Settings as above. Leveraged positions show positive capital growth if the asset changes price to the right direction.

Empirical evaluation of leveraged v3 positions

The theoretical analysis above ignored any fees, including both the swap fees earned by the liquidity provider and the borrow and flash loan fees incurred for the leveraged positions. To determine the fair value of the fees the LP can afford to pay, we conducted an empirical evaluation of the fees earned from deploying such a position in a real Uniswap pool. For the experiments, we selected the USDC/WETH 0.3% pool on the Ethereum mainnet and evaluated the position’s performance from October 1 to December 31, 2023. During that period, the price of ETH experienced some drawdowns but rose most of the weeks, appreciating approximately 36% from the start to the end.”

ETH price action, October to December 2023

The backtesting used the following methodology:

  • A fixed amount of capital was initially allocated, the same for each position.
  • The leveraged positions also took on debt equal to the size of the capital (2x leverage).
  • On the first day of the period, each position was added to the pool. After 7 days had passed, each position was removed, and its fee return and impermanent loss/gain were measured.
  • The total return on the capital was computed as the sum of fees + IL.
  • During each subsequent week, all positions were deployed around the pool’s price at the time, with the initial amount of capital (no compounding).
  • No liquidations were simulated. The maximum drawdown on capital (vs holding cash) was 6% in the worst week, for the leveraged position that borrowed USDC. A drawdown of this size makes it unlikely that the protocol’s liquidation threshold would be reached.
Fee returns during the test period

The fee returns (above) show that 2x leveraged positions outperform the normal positions, almost exactly by a factor of 2x, due to larger liquidity. They also usually outperform the narrow position, due to staying in the range for longer.

Capital returns vs holding cash

The figure above shows the principal capital appreaciation / depreciation, without including the fee returns. It shows that during the weeks with positive price action, all except “borrow ETH” strategy leads to capital growth relative to holding cash. The growth is most limited for the narrow position, because it rapidly goes out of range.

The “borrow ETH” strategy has the curious property that is never has positive returns as compared to simply holding cash. (It’s symmetrical with respect to the price change direction — see the figure “Position values under volatile asset price change” above for a confirmation.)

Impermanent loss / gain during the test period

Unlike the previous figure, this figure compares against 50:50 HODL instead of simply holding cash. It shows that during the weeks with positive price action, the “borrow USDC” strategy leads to capital growth, while the “borrow ETH” lead to higher losses, with down to — 500% APR, annualized. In the weeks with negative price action, the opposite happens. This shows their higher sensitivity to market risk.

Total returns (fees + IL) during the test period

The figure above show the fee + IL returns. You can think of the graph as the profitability of the LP against the 50:50 HODL strategy, which initially allocates half of the position to ETH, half to USDC.

The final table (below) shows the cumulative profit and loss (PnL) during the 3-month test period.

Average returns during the test period, without including borrowing costs and transaction costs. While two of the four strategies have positive returns against HODL, the leveraged strategy that borrows USDC massively outperforms the others, as it benefits from ETH price appreciation.

Due to the positive ETH price action, the cumulative return of the 50:50 HODL benchmark itself is 18%, against holding cash.

Since the test period was three months long, to get the annualized APR values, multiply the numbers in the table by a factor of four. For example, “20.3” corresponds to the APR of 81.4%. This allows to estimate the maximum transaction and borrowing costs the LP can incur while still being profitable. Of course, past performance is no guarantee of future success!

More reading

Conclusion

Main takeaways:

  • YLDR as a lending protocol allows to use v3 positions as collateral, which is useful for implementing delta-neutral and bearish LP strategies among other things.
  • YLDR as a leveraging protocol allows to increase the returns from fees and asset price changes, usually at the cost of taking some more risk, including much higher market risk.

Disclaimer. This research was supported by the YLDR protocol. This post is for general information purposes only. It does not constitute investment advice or a recommendation or solicitation to buy or sell any investment and should not be used in the evaluation of the merits of making any investment decision. It should not be relied upon for accounting, legal or tax advice or investment recommendations.

--

--