SIP-358: Introduce `lockedOiMultiple` to Perps V3

Author
StatusRejected
TypeGovernance
NetworkBase
ImplementorTBD
ReleaseTBD
ProposalLoading status...
Created2024-02-01

Simple Summary

This sip aims to enhancing the resilience of the v3 staking system, by introducing a multiplier applied on the minimum required credit capacity associated with a super market. This multiplier becomes active during periods when liquidation are in the process of being consumed via the rate limiter and reverts to 1 otherwise. The multiplier raises the minimum credit requirement on a given perp super market, preventing liquidity providers (LPs) from reducing their credit capacity until the liquidation process is completed.

Abstract

The lockedOiMultiple is a governance-configurable parameter, that default to 1 when there are no positions in a pending liquidation state. However, it dynamically switches to the configured value (e.g., 100x) when positions are in the process of being liquidated. This new parameter is implemented in the requiredCredit function and can be configurable at the supermarket level.

Motivation

Perps V3 innovation departed from the Perps V2 endorsedLiquidator approach for liquidation execution, opting instead for a rate-limiting system. This system distributes large liquidations, akin to the method employed by centralized exchanges in unwinding large positions via a time-weighted average price (TWAP). However, this strategy introduces the potential challenge faced whereby liquidity providers exit during periods of heightened price volatility to avoid potential losses on their staked assets. To address this, the introduction of the lockedOiMultiple restrict liquidity providers from being able to exit during times when liquidation are being rate limited.

Specification

The specification includes incorporating a new function requiredCreditForUndelegation shown below:

    function requiredCreditForUndelegation(uint128 marketId) internal view returns (uint) {
        return
            PerpsMarket.requiredCredit(marketId)
                       .mulDecimal(GlobalPerpsMarketConfiguration.lockedOiMultiple());
    }

Incorporating the below function to GlobalPerpsMarketModule:

    function lockedOiMultiple() public view returns (uint256) {
        if (liquidationModule.flaggedAccounts.length > 0) {
            return lockedOiMultipleD3;
        } else {
            return 1;
        }
    }

Status update as per authors' request

Test Cases

  • Setting the lockedOiMultiple to 1,000:
    • When liquidations are being rate limited
      • When a staker attempts to decrease his delegated liquidity
        • ❌ The transaction reverts due to the minCreditCapacity being artificially increased
    • When there are no pending liquidations in the queue
      • When a staker attempts to decrease his delegated liquidity
        • ✅ Then the transaction succeeds and the the lp's credit capacity associated with that perp supermarket is reduced

Configurable Values (Via SCCP)

  • lockedOiMultipleD3 is a configurable value that becomes active when liquidations are being rate limited

Copyright and related rights waived via CC0.