The Levana Well-funded Perpetual Swaps systems is designed with three different categories of users in mind:
- Traders wishing to speculate on price movement
- Liquidity providers wishing to receive passive income from fees (sometimes called “real yield”), while minimizing price exposure risk
- Arbitrageurs looking to take risk-free (or very low risk) profits through trading fees while providing services to the markets (sometimes this is called “Cash and Carry”, we’ll describe details of this below)
The important bit in (2) is “while minimizing price exposure risk.” Let’s start off by explaining what this risk is.
Price exposure risk
Note: the numbers here use a few simplifications, like ignoring trading fees and liquidation margins. In practice, the numbers would end up slightly different.
Let’s say that a trader opens a long position with a deposit of $100 of USDC and 10x leverage. The trader sets a take profit price such that he can receive a maximum of $500 profits on the position. That means that:
- If the price moves up far enough, the trader will take home the maximum profits (what we sometimes call “max gains”), and would collect 600 USDC from the protocol: the original 100 USDC deposited and the 500 USDC for the price movement.
- By contrast, if the price moves down far enough, the trader will lose all of his deposited collateral and will take nothing home.
That begs two questions:
- Where did the extra 500 USDC come from in the first scenario?
- Where did the 100 USDC go in the second scenario?
The answer to both questions is the same: the liquidity pool. Whenever a trader opens a position, they borrow some amount of counter-collateral from the liquidity pool. When a position closes, the liquidity pool is impaired, meaning the amount of money in the pool will go up or down.
When traders win a trade, the impairment to the liquidity pool is negative, meaning that liquidity providers lose money. By contrast, when traders lose, the impairment is positive, and LPs make money.
This impairment is another way of saying price exposure risk. Essentially, when a trader opens a long position and borrows some funds from the liquidity pool, he is forcing the pool to enter a short counter-position. This exposes liquidity providers to price exposure risk, which is what we want to avoid. The question is: how do we minimize the risk?
TLDR: LPs are not betting that the underlying assets will go up or down; they are betting whether traders will tend to win or lose more.
Delta neutrality
Question: Do LPs always lose when traders win?
Answer: Well, it depends on the delta neutrality…
Our primary mechanism for reducing risk to LPs is to create incentives in the platform towards balancing long versus short interest. This isn’t unique to Levana Perps; other Perps systems employ funding payments to encourage this balancing. Levana Perps additionally includes the Delta Neutrality Fee (DNF), which, for our purposes, can be thought of as an instantaneous funding rate payment. Instead of slowly accruing funding payments for taking an unpopular position, DNF payments provide a lump sum as soon as you perform an action.
If the incentives work out well, then as long interest increases versus short interest, the incentives for opening a short position will increase, and arbitrageurs (that third category from the top of this article) will be rewarded for opening up shorts and balancing the protocol. The same logic applies if the protocol is overly short. (We’ll discuss details of this arbitrage at the end of the article.)
Assuming the long and short interest is exactly equal, LPs are fully protected from price exposure. Any loss through impairment LPs experience on long positions will also have an equal gain through impairment on short positions, and vice versa.
To give LPs an idea of the risk of an individual market, we provide a metric called the delta neutrality ratio, which is the net open interest (long - short interest) divided by the size of the liquidity pool. This number has the following meaning:
- 0: no risk to LPs
- Positive: LPs will lose money if the price goes up. The greater this number, the greater the risk.
- Negative: LPs will lose money if the price goes down.
The first thing to consider as a liquidity provider is: am I comfortable with the delta neutrality ratio on this market? Levana Perps is designed to provide an automatic feedback mechanism when the delta neutrality ratio is too far from zero, specifically:
- LPs will manually withdraw liquidity due to the higher risk
- Lower liquidity in the market will lead to a higher utilization ratio (percentage of funds locked up against trader positions)
- Higher utilization ratio results in a higher borrow fee
- Higher borrow fee means more fees paid to LPs, to compensate for the risk they are taking on the market
TLDR: APR rewards to LPs on Levana are risk adjusted rewards, because your principal deposit is at risk!
LP and xLP tokens
Let’s say we launched a brand new market that uses the USDC stablecoin for collateral. Initially, the liquidity pool is empty. When the first LP comes along and deposits 1000 USDC, they will receive in response 1000 LP tokens. At this point, they could burn 1000 LP tokens for 1000 USDC. We say that the value of an LP token is 1 USDC at this point. All markets start off with this 1-to-1 ratio. And LP and xLP tokens both have the same collateral value, so we’ll talk about the LP tokens only for the rest of this section.
Suppose after this a trader loses 500 USDC on a position. This would be a positive impairment to the liquidity pool of 500 USDC. The size of the pool has now increased to 1500 USDC (the original 1000 deposited plus the 500 from impairment). However, the number of LP tokens is unchanged. That means that the 1000 LP tokens are worth 1500 USDC, or a token value of 1.5 USDC per LP token.
In this scenario, the original depositor could now burn their 1000 LP, take home 1500 USDC, and have a 500 USDC profit. That sounds great, but recognize that this is price exposure risk. It turned out to be a positive for the LP this time.
However, the same scenario could work in reverse. If instead of losing 500 USDC, the trader won 500 USDC, the LP token price would go down from 1 USDC to 0.5 USDC. Instead of increasing the value of the holdings by 50%, the LPs would have lost 50%.
Note: The ratio of LP to USDC is not impacted by further deposits. A high LP ratio, or low LP ratio does not necessarily mean that the pool has consistently move in one direction
Consider:
A pool is empty: 1 LP = 1 USDC
1000 USDC is deposited: 1 LP = 1 USDC
A trader wins 500 USD: 1 LP = 0.5 USDC
10,000 USDC is deposited: 1 LP = 0.5 USDC
When you see a pool has $1M USDC, and a ratio of 1 LP = 0.5 USDC, that does not mean that traders have necessarily won $500K USDC, they may have only one a much smaller amount when the pool was smaller.
These are extreme examples where a massive percentage of the liquidity pool was tied to a single direction of trade, which makes the risks to LPs much higher. The purpose is to illustrate the risks being taken by LPs. To put one more example in place, imagine if instead two traders opened up two different positions, one long and one short. If the positions are both the same size, then any gains on the one position will be a loss in the other. Net open interest would be exactly 0, since long and short interest is equivalent, and therefore the Delta Neutrality Ratio will also be 0.
Investigating LP/xLP value drops. Is it an exploit?
Levana Core contributors and Liquidity providers are rightfully concerned about the value of their deposits within Levana. If the value of the LP token falls, there are essentially three things that could have occurred:
- Trading was lopsided to either the long or short side, and there was a price movement while that happened. We try to minimize the lopsided-ness via arbitrage and incentivization, but it can still happen. And the farther the Delta Neutrality Ratio is from 0, the higher the risk.
- There could be some kind of a manipulation of the spot price. This could be like the December 2023 exploit, which leveraged the ability to replay old price updates to launch a “precognition” attack on the protocol. (Note that, following this exploit, the Levana Perps protocol received a significant rewrite and reaudit to change how prices were fed into the system, more details available in our post mortem December report, and the audit report.)
A more extreme version of this would be someone moving the spot price by making large buys and sells in the spot market outside of Levana (ex Binance). We have attempted to mitigate this attack by setting both trading fees and delta neutrality fees per-market based on the size of the spot market (and, specifically, the liquidity depth). The protocol’s goal is to make it unprofitable to manipulate the spot market price. - A more inherent bug in the system: bug in the smart contract code, attack on the underlying chain, bridge attacks, etc. Most of these wouldn’t result in the value of an LP token falling, but it could theoretically happen with some bug categories.
When the Levana core contributors observe (or detect through our automated detection systems) a significant change in LP token value, we investigate recent trading activity. We look for signs of manipulation, such as positions being opened and closed in quick succession. (We have a number of other detection mechanisms in place, but do not share these publicly for reasons of security concerns.)
All data we use for this analysis is available on-chain. We may elect in the future to provide tools or data exports with the full history of positions per market so others can perform their own analyses.
Please mention to mods on Discord if you would be interested in receiving such access if it becomes available.
I lost money as an LP, what should I do?
The most important message in this document is: as an LP, you can lose your principal. The Delta Neutrality Ratio is your best indication of your risk to this loss. If you are uncomfortable with that risk, you should consider other mechanisms for earning passive yield.
That said, there are mechanisms that you can leverage to reduce your risk as an LP, and to even make money in the process. The idea here is to arbitrage the market yourself, a.k.a. perform cash and carry. By doing this, you will profit on the incentivizations given for people who balance markets while protecting your investment as an LP. The basic mechanism for cash and carry is:
- Observe that a market is overly long (or overly short). The https://whales.levana.finance/ page is a convenient way to see that: if you see extreme funding rates, a market is ripe for cash and carry.
- Look at the stats page for that market, e.g. https://trade.levana.finance/stats?network=osmomainnet1&market=atom_usd. Determine the net notional by comparing long vs short interest.
- Look at the Market Sentiment section of the Levana markets page https://trade.levana.finance/osmosis/markets
- Open up an unpopular position that moves the market towards balanced. You don’t want to over-correct, because then you’ll be moving the market out of balance and paying more in DNF and funding payments.
- To minimize your risks from price exposure, open an opposite position in a separate market. The easiest way to do this happens when a Levana market is overly long:
- Open a short position on Levana to balance the markets
- Buy up the same asset on the spot market to gain long exposure
I think I found an exploit
If you believe that prices are being manipulated or a bug in the Levana contracts is being used to extract profits from the protocol, please report it. However, since the relaunch of markets in January 2024, we have seen no evidence of price manipulation occurring within the system. Instead, what we’ve seen is the beginnings of a bull market, markets that tend to skew towards long, and lots of upwards price movement. This has led to lucrative Cash and Carry opportunities and some trader profits and therefore LP losses.
Note, however, that we’ve also seen some large trader losses, and some markets have seen LP token value increases in 2024.
One of our top goals right now is to arrange partnerships with external firms to perform more aggressive cash and carry on the protocol. If you are interested in being a cash and Carry partner, join our Discord and contact a mod.
As that rolls out through the first 2 quarters of 2024, we expect to see a significant stabilization of the LP token values across markets, properly living up to our goal of protecting LPs from price exposure.