⛑️ Risk and Safety
Delisting Process

Delisting Process

Delisting a perpetuals market can occur in a tail risk event, but the protocol has an on-chain procedure in place similar to the expiry of any derivatives contract (futures, options).

The process is as follows:

Perpetual Markets

  1. The market immediately enters "reduce only mode" once an expiry date is set

    • all new orders are forced to have reduce only flag

    • all current orders that will increase risk will get cancelled on fill attempts

    • no new funding rate updates

    • users cannot settle unrealized P&L prior to expiry

  2. After the expiry date, the market can lock in a settlement price

    • must call the instruction: settle_expired_market
      • the target price is the amm's calculated 1-hour oracle twap but is altered such that it allows for full solvency across all users
  3. After the expiry date + optional time buffer, users can settle their "expired positions" at the settlement price, which are closed

    • the optional time buffer is the settlement duration, which acts as a buffer for liquidations

    • any necessary insurance fund draws and/or social loss can occur

    • at position closure, the taker fee is applied (so as to encourage close during reduce only mode)

  4. Once the number of users in the market reaches zero, the remaining balance PnL Pool can be settled into the quote asset's Revenue Pool

Spot Markets

  1. The market immediately enters "reduce only mode" once an expiry date is set

    • this blocks new borrows, new deposits, and new buys in the market
  2. After the expiry date, the market is set into "force close mode" [TODO]

    • deposits are sent back to the user's associated token address up to an amount that still satisfies their margin requirement

    • opens the possibility for liquidation of borrows and/or swaps of deposits to other accepted collateral