Trader FAQs

The Osmosis epoch

The Osmosis chain has a daily Epoch. This is a period of time when the chain calculates rewards for AMM users. During this period of time, no new transactions can land on chain. Also, at the time of writing, there are known issues with the Osmosis codebase, and the epoch can trigger node crashes after it completes. The end results of this is that, for about 15 minutes every day, it is difficult or impossible to get new transactions to land on chain.

At the time of writing, the Epoch occurs daily at 17:16 UTC. (You can check out our querier endpoint for next Epoch for up-to-date information.) The Levana Perps UI will display a banner counting down to the Epoch before it occurs, and will continue to show the banner afterwards until it can confirm that Epoch processing has finished. Unfortunately, even at that point, there may still be some remaining transaction downtime until all nodes finish process and recover from any crashes that may occur.

It's important to note that, as a result of this period, some triggers will either not fire at all or may fire at an unexpected price point. This is because during this downtime, finer grained price updates will not come through. Instead, there will be a price jump from the last update before the Epoch until transactions begin processing again.

This is an ongoing issue that the Levana team is working on in tandem with the Osmosis team. The goal is to both resolve the node crashing issues, and to minimize the length of time that the Epoch lasts.

Delta Neutrality Fee and DNF tax

Before understanding Delta Neutrality Fee and its rate, it would be helpful to understand the concept of Delta Neutrality.

Delta neutrality is a state where the total notional value of long positions is equal to the total notional value of short positions. This is important for two reasons:

  • It protects liquidity providers (LPs): LPs provide the collateral that is used to support perpetual swap positions. If the protocol is not delta neutral, this can lead to a situation where LPs are exposed to significant price risk. The delta neutrality fee helps to mitigate this risk by incentivizing traders to open positions that move the protocol towards delta neutral.

  • Ensures fair and efficient market: When the protocol is delta neutral, it means that traders are paying a fair price for the liquidity that they are using. This can help to prevent market manipulation and ensure that the protocol is a good place to trade perpetual swaps.

In Levana, the delta neutrality fee is a mechanism that aims to keep the protocol close to delta neutral. The total DNF fee you will be charged depends on these factors:

  • Current Spot Price
  • Net notional value: Refers to the total value of the underlying asset
  • Notional delta value: The amount of change that would occur to the net notional value when you open or close a position.
  • Fee cap: A fee cap acts as a safeguard, limiting the maximum fee that can be charged in any situation, including extreme market volatility.
  • Sensitivity parameter: Parameter denoting the price elasiticity of the spot market.
  • Liquidation margin factor: Applicable only when updating or closing the position.

You can read more details about the calculations in the whitepaper.

When opening a position in Levana, the "Delta Neutrality Fee" (DNF) reflects the total impact of the position on the protocol's delta neutrality. This includes:

  • DNF paid/received on opening: This is the immediate fee charged or credited based on the position's direction and size.
  • DNF that would be paid/received upon closing: This represents the estimated future fee if the position were closed right after opening.

Because of this, DNF fee will always be positive when opening a position. This ensures traders contribute to delta neutrality even if the position is closed immediately.

As market conditions change, the DNF may flip from positive to negative, meaning the trader receives this fee for their contribution to delta neutrality.

DNF Tax Rates

The DNF tax is set particularly high for the OSMO_USD market (50%) and some other low liquidity markets. This decision stems from the October attack on the LP pool for OSMO_USD, which we disclosed in this blog post. For ATOM_USD market it is set to a more reasonable 25%.

Viewing DNF for Open Positions

The DNF for an already opened position can be viewed in the Open Positions list. You can find the "+" button near the total fees paid by the position, you may need to scroll right for that.

DNF Fees

You can click that button to view the fees. It will be the same as shown when opening the position and it will change as the market's net notional value and the spot price changes.

Price slippage

Quick fix: if you've hit this page because you received a price slippage error on the frontend, normally you can simply check the new entry price, confirm you're happy with it, and try again. If you continue getting price slippage errors, the market may be extremely volatile. In the overflow menu (top-right of the screen), you can go to settings and increase the price slippage tolerance to a higher value.

Explanation

Price slippage is a mechanism built into many DeFi protocols. It provides a defense for users against price movements hurting their trades. For example, with Levana Perps, consider a situation where you want to open a long position on an asset. You're on the Perps site, and you see an entry price of $10. This is a value queried in many cases from an off-chain price oracle with price updates coming through at a sub-second level. You decide that $10 is a good entry price for a long position, so you enter your position details, check the price one more time, and click "open long." After approving the message in your wallet, the transaction lands on chain, and you have a new long position.

You might expect that the entry price will be exactly $10. After all, that's what you saw in the web interface. However, this can't be guaranteed. In the time between your web browser fetching the $10 price point and your transaction eventually landing on chain, there have been a number of delays:

  1. Normal network latency between your browser and the price oracle server
  2. Time spent approving the transaction (which can be significant with hardware wallets in particular)
  3. Transaction settlement time: the time during which your transaction is waiting to be included in a block

In that time period, it's entirely possible, and in fact likely, that a new price point will become available from the oracle and submitted to the Levana Perps market contract. Taking an extreme example, suppose the price jumped to $15. This would mean (1) you missed out on a significant amount of price movement in your favor, reducing your profits, and (2) you're exposed to significantly more risk in your position, since any movement below $15 will now be a loss.

Price slippage is the safety mechanism that prevents this from happening. When you submit a transaction to the chain, you indicate the price you are trying to use as current price, and a slippage factor. For ease of math, let's say the slippage value was 5%. (The default is much smaller at 0.5%.) When you try to open your long, the frontend will tell the smart contract "the current price is $10 and I will only allow the price to move against me by 5%." If, when your transaction lands on-chain, the current price has moved more than 5% (to over $10.50), the contract will reject the position, since it may harm you.

The usual solution to a price slippage error is to try again, assuming you're still happy with the current price. If you continuously get price slippage errors, there are two likely causes:

  1. Extreme market volitility, where the price is moving so quickly that you can't snag the right entry price. For this case, increase the price slippage tolerance in the settings menu can be the right solution, assuming you're comfortable with the higher risk involved.
  2. This could also be a frontend calculation bug (see next section), where the calculated price is incorrect. This will usually display as getting a price slippage error before approving the transaction in your wallet. If you see this happen multiple times in a row, please open a support issue.

Note that price slippage applies to opening, updating, and closing a position.

DNF (Delta Neutrality Fee)

One further complication in price slippage. An important stability mechanism in Levana Perps is the Delta Neutrality Fee, which encourages a balanced protocol and helps prevent spot price manipulation attacks from succeeding. In practice, the DNF ends up acting as a modifier to the entry price. If you open a long position when the market is overly long, it is conceptually similar to having a higher entry price. (The reverse is true too, which is part of why opening unpopular positions can be a successful trading strategy.)

When setting the "current price" in the open position transaction, the frontend includes a DNF factor in the current price to account for this. Similarly, the market contract computes a DNF factor when comparing the price against the current price.

In practice, this means that in addition to extreme spot market movement, large position movements within Levana Perps can also lead to a price slippage error occurring. The same advice as above applies: you can retry the transaction assuming you're still happy with the position details. In the case of large DNF swings, you'll see an increase in your DNF fees.

Leverage Change over time

In order to understand why the position's leverage changes over time, it's important to understand the math behind the leverage calculation.

The position's notional size is calculated once when the position is opened, and it does not change over the position's lifecycle:

  • notional-size: is fixed
  • entry-price: is also fixed
  • collateral: changes over time (more below)

This leaves us with the leverage that will have to change over time to keep the equation stable.

Position Collateral

Over time, and as the market moves and fees are paid, your active collateral (the available collateral after fees and price movements) will fluctuate.:

  • If the market moves in your favor (e.g., the price of an asset you are long on increases), your active collateral increases, and thus, your effective leverage decreases.
  • If the market moves against you, your active collateral decreases, and your effective leverage increases as your position becomes riskier.

Ongoing Fees: Additionally, ongoing fees like funding payments or borrow fees will be deducted from your active collateral, which further affects the leverage over time. Also note that funding payments can also be received by the position.

Liquifunding: Levana Perps also regularly collects the fees and checks for sufficient liquidiation margin through a process called liquifunding. During this process, the system sets aside collateral for liquidation margins and realizes the fees incurred to that point, but it doesn't have any step-wise impact on leverage.

In short, while your leverage is fixed at the moment you open a position, it changes dynamically as market conditions, fees, and price movements impact your active collateral.