DerivaDEX and Volatility:

A LUNAPERP Case Study

Ainsley Sutherland
DerivaDEX
6 min readMay 24, 2022

--

How would DerivaDEX have managed under the market volatility seen in the past couple of weeks? How would DerivaDEX have managed had some of the affected assets been directly used by the exchange– for example, had a LUNAPERP product been available, or UST been accepted as collateral?

Understanding the answer to this question can help you better understand exactly how DerivaDEX works, so let’s dig in. This article will cover the (theoretical!) listing and delisting of LUNAPERP, and a future article will look at the different case of UST collateral (multi-collateral likely being farther off as a supported feature of the exchange).

In this article, you can learn

  • How assets are listed and delisted from DerivaDEX
  • What happens if the insurance fund runs out
  • How cross-margin affects liquidations and volatility on DerivaDEX

Listing trading pairs: Governance and Risk

The most important feature at play here is whether LUNAPERP, or UST, are in use by the exchange at all. This is a question that is left entirely to the community.

DerivaDEX is solely managed by the DerivaDAO, a decentralized governance community made up of DDX token holders. No trading pair can be listed without going through the successful proposal and voting process. Likewise, no new collateral types can be added without going through this process as well.

Some important elements the DerivaDAO community should consider when building a process for trading product proposals are

  • What is the expected trading volume? Expected fee revenue?
  • Is the product likely to experience high volatility? Why?
  • What key indicators should be met to trigger a delisting proposal?

Listing LUNAPERP

Using a theoretical LUNAPERP trading product as an example, this exercise takes a look at what happens when a trading product on the exchange trades rapidly towards zero. While the specifics always depend on the open interest, size of the insurance fund, open positions, and other variables, this post walks through a general outline of what could happen.

Phase 1: Volatility and Liquidity

At first, speculators are eager to bid on both sides of the book while the outcome is very unclear. This is an excellent scenario for DerivaDEX, because volatility with good liquidity results in fees from trading as well as positive liquidations all accruing to the insurance fund. From February 21 to May 8, LUNA ranged from an open of about $50 to highs close to $120.

From Binance, this chart snapshot shows the daily chart of LUNA for about 3 months.

Price volatility results in liquidations, but good liquidity means that liquidated positions are easily sold to counterparties, before they hit their bankruptcy price. These positive liquidations add value to the insurance fund, and traders who are on the right side of the price movement are able to close their positions easily.

Recall– on DerivaDEX, PnL for open positions is settled regularly (approximately every 8 hours).

Phase 2: Volatility, reduced liquidity

UST began to drift off its peg on May 9th. Because of the relationship between these two assets, (which we will NOT get into here) the price of LUNA went from about $64 to $30 in one day. On the second day, LUNA lost more than 90% of its value from recent highs. Liquidity providers may have started withdrawing or reducing their exposure in order to protect themselves from this directional movement.

From Coinmarketcap. UST starts to depart from the peg on May 7th and 8th, before losing it completely over the next week.

At this point, the exchange governance should be observing LUNAPERP and considering what thresholds must be passed for delisting.

However, there are still users with active, open positions, and users trying to trade the asset. The liquidation engine will still be hard at work, but it becomes more likely that liquidations will now result in negative liquidations, where positions are traded at a loss (i.e., beyond their bankruptcy price).

To protect winning traders, the normal course of action here is for the exchange to draw from the insurance fund to pay winning traders, because the counterparty does not have enough collateral to cover what they owe.

By default, the entirety of the organic insurance fund (capitalized through fees and positive liquidations) is available to cover liquidations in any trading pair. It will be the decision of the DerivaDAO whether to restrict the size of the active insurance fund, and how to hold in reserve any excess.

A note on cross-margin:

Because DerivaDEX uses cross-margining for collateral, volatility in one trading pair can also affect liquidations in other trading pairs.

For example, a trader with an open BTCPERP position may be liquidated due to losses in their LUNAPERP position. While it is likely that BTCPERP has better sustained liquidity, and that position can be liquidated in a positive liquidation, overall volatility can increase — often actually resulting in promising trading opportunities.

What happens when the insurance fund runs out?

If the insurance fund is depleted to zero through negative liquidations, the exchange smoothly switches to “auto de-leveraging” (ADL) protocols.

This means that if the insurance fund is totally depleted, all traders — including those with no direct exposure to LUNAPERP — will now be subject to ADL if their counterparty experiences a negative liquidation.

How does ADL work?

Under ADL, the worst-case scenario is that winning traders have otherwise-profitable positions automatically closed. Their position size will automatically be reduced when their counterparty is liquidated (in a negative liquidation only).

For example, a trader could have an open short position of 1000 units of LUNAPERP, for an PnL of $10,000. At the time their counterparty is liquidated, their counterparty’s position cannot be liquidated for that value (the bankruptcy price of the position). Instead, a speculator is willing to purchase this position for $1,000.

The winning trader cannot receive more than this $1,000 in profit, because that value of LUNAPERP changed so dramatically, and the insurance fund was fully depleted. When the liquidation engine sells the position to the speculator, the size of the trader’s open position will be reduced (ADL’d) such that it reflects this maximum profit of $1,000.

Phase 3: Limited volume, delisting

At this point, the insurance fund may or may not be fully depleted, depending on how much exposure traders had to the LUNAPERP asset. While normal trading in other assets should continue to capitalize the insurance fund via fees and positive liquidations, a low-liquidity, volatile coin is likely to continue to result in low demand and negative liquidations.

Additionally, traders will have difficulty closing open positions, because there is no interest from other traders. If the orderbook is empty, open positions cannot be closed. The best a trader will be able to do is withdraw the maximum collateral after a PnL settlement event, which is everything except for the collateral required to maintain the open position.

Delisting

In this case, the asset shows little sign of recovery, and may be a candidate for delisting. Including these zombie assets on the exchange exposes the insurance fund, and the exchange itself, to greater risk (with little reward in the form of positive liquidations and trading fees).

Delisting occurs via a governance process. Once governance passes a delisting event proposal, a “wind-down” feature will close all open positions at the mark price at the point of the delisting event, and all open orders will be canceled. From that point forward, the asset will not be tradeable on the exchange unless it is re-listed via governance.

Stay in touch!

The exchange is currently in a bug hunt trading session. For more info, make sure you fill out the form at register.derivadex.io and then head over to beta.derivadex.io for testing!

Make sure you don’t miss the next post — sign up for the mailing list!

  • Join the Discord to learn about upcoming opportunities and to join the DerivaDEX community!
  • Follow on Twitter!

--

--

Ainsley Sutherland
DerivaDEX

Product Lead @ DEX Labs (building DerivaDEX & more)