Perpetual Protocol 🥨

Posted on Apr 08, 2022Read on Mirror.xyz

How to Provide Liquidity with Leverage on Perpetual Protocol v2

Providing liquidity to decentralized exchanges to facilitate cryptocurrency swaps is one of the most popular ways of earning yield in DeFi, giving you the chance to make money no matter what the market conditions are.

With the introduction of makers in Perpetual Protocol v2, you can also provide liquidity with leverage, similar to how you can open long or short leveraged positions as a taker. In this guide, we’ll provide a walkthrough of how to provide liquidity with leverage on Perpetual Protocol.

Getting Started with Leveraged LP’ing

To get started with providing liquidity on Perpetual Protocol (Perp), navigate to the sidebar, select Pools and choose which market you want to provide liquidity to.

When selecting a pool, check the base APR and pool rewards APR:

  • The base APR indicates how much you can earn in trading fees,
  • The pool rewards APR shows how much you can earn in PERP rewards, which will be proportional to the amount of liquidity you have provided. That means you can earn more PERP through liquidity mining for markets with a lower Total Value Locked (you’ll have a higher proportion of the pool with $10,000 if the TVL is lower, earning more PERP from the pool rewards).

You can think of liquidity provision on Perp as like being a maker on a centralized exchange using limit orders. When takers open trades that use your liquidity, you will effectively take the opposite position to those traders. In return for providing liquidity, each time an asset within your range is traded, then you will receive a proportional split of the 0.10% trading fees.

To start earning fees from supplying assets to a pool, click on ‘Add Liquidity’. Your max buying power will be shown on the top right-hand side, which is equal to 10 times your collateral. Enter the amount of the base asset, (or the amount in USD), and then select your price range. You’ll earn a portion of the fees for whenever takers use your liquidity to open or close their positions within the selected price range.

As a liquidity provider, you’ll have to decide whether to take on a bet on what’s happening now or in the future and re-balance your liquidity position as the market evolves. You’ll also want to decide whether you want single-sided or double-sided liquidity.

For instance, if you enter a range price completely below the market price, you can only provide liquidity in USD. If you think the market is going to fall and then trade within a certain range, you can provide liquidity in this way. Compared to liquidity provision on Uniswap v3, you only need USDC to provide liquidity. And when the time you need another asset to provide liquidity with, the protocol mints and lends that asset to you in the form of vTokens (e.g., vETH).

Finally, you can select your slippage tolerance, then click on ‘Add Liquidity’ and confirm the transaction in your wallet.

Why LP with Leverage?

LP’ing with leverage is easy on Perp v2 since you can supply an amount of assets greater than the value of your account. For example, if you have $10,000 in USDC, you can supply liquidity of up to $100,000.

But why would you want to use leverage when providing liquidity?

There are two main benefits:

  1. Achieve greater capital efficiency
  2. Capture a larger portion of the pool’s trading fees and receive more PERP from the pool rewards (a total of 5K PERP is allocated to each market per week)

With $10,000 in USDC, you can only supply that exact amount or less to pools for decentralized exchanges like Uniswap v3. However, you can do more with less by LP’ing with leverage on Perp, using as little as $1,000 to provide the same amount of liquidity.

However, it’s also worth remembering that, as well as your earnings, your impermanent loss can become amplified.

Selecting a Price Range

When you are providing liquidity above and below the market price, this means as a maker, we are willing to buy and sell in this range. While LPs use USDC as collateral, vTokens are minted and then loaned to you (more on this in the following).

For our example, Perp’s clearinghouse contract places the collateral into a vault, then mints 1 vETH and the cost basis is stored. Since we are providing liquidity below and above the market price, 2143.60 vUSD is also minted. As long as the market remains in the price range of $2817.49 and $3646.74, this liquidity position will earn fees.

If the price moves out of the range, you’ll be 100% positioned into the under-performing asset (e.g., in USD if the price of ETH goes above the upper boundary, or in ETH if the price of ETH goes below the lower boundary), until the price moves back into your range.

The more concentrated your position is, i.e. the tighter the trading range is, the higher amount of fees you’re going to earn and the higher the APR. However, you’ll face a greater impermanent loss, so you may have to manually adjust the range more frequently. While you’ll earn higher fees from a tighter price range, if the market price goes out of that range, then your liquidity becomes idle. Once the price moves back into your range, your liquidity position will automatically be restarted.

Managing Liquidity Positions

Once you have opened a liquidity position, you’ll be able to see the composition of the assets you are supplying to takers, as well as your total liquidity, total fees earned, impermanent position and impermanent loss. Once your position has been open for a while, the base APR and rewards APR will be displayed in the UI.

As the price moves further away (in either direction) from your entry price at which you provided liquidity, the margin ratio decreases and account leverage increases. Keep an eye on the margin ratio (=collateral/position), as this should remain above 6.25% to prevent liquidation. For example, with a leveraged liquidity position of $6,000 and collateral of $1,200, the margin ratio would be 20%. If your free collateral falls to ~$375, then you face the risk of liquidation.

To rebalance liquidity, you’ll have to remove your entire position and enter a new one. The remove button will allow you to remove anywhere between 1% to 100% of your liquidity. If you remove your liquidity, then you’ll end up realizing the impermanent position.

The vTokens that were minted when providing liquidity must be returned, and depending on the change in the price of ETH, we’ll end up having a left-over position, either long or short, which you can close from the main trading view.

When using leverage, it’s important to know that you can be liquidated. Continuing with the example above, if the price moves below the lower boundary of $2817.49, then your impermanent position will be 1 ETH long. If your collateral is not enough to maintain the maker position, it will be liquidated. Your liquidation price will depend on various factors, such as the price range you set, the initial starting price, how much collateral you use, and volatility of the market.

To give you a clearer idea of the PnL of a maker position and under what circumstances it will be liquidated, our community member Panprog created this calculator so you can visualize some examples. The chart below shows a hypothetical example where the starting price of ETH is equal to $100. The various curves show different ranges for a liquidity position while the black dotted lines show the points at which your losses equal your collateral for x3, x5 and x8 leverage.

When using x3 leverage, you will be liquidated slightly before a loss of 33.3%. For x5 leverage, liquidation will occur just before your loss reaches 20% and for x8 leverage, the figure is 12.5%.

Liquidity positions on Perp v2 can be tracked with this handy tool from Seedle. Also, to help you track the price volatility of a particular market and set an appropriate price range, you can use tools such as the Average True Range or the Bollinger Bands (both accessible from Indicators via the trading charts).

For example, the Average True Range measures the average price fluctuation over a certain time period, which can help you set the upper and lower boundaries based on the volatility of the market. Similarly, you could use the difference between the market price and Average True Range to provide liquidity on one side only.

In summary, LPs on Perp can utilize leverage to earn a greater share of fees and pool rewards by supplying an amount of assets greater than the value of your trading account. However, it’s important to be aware of the margin requirement, select an optimal price range based on market conditions and re-balance your liquidity as the market evolves.

Links