SIP-358: Introduce `lockedOiMultiple` to Perps V3

Author
StatusDraft
TypeGovernance
NetworkBase
ImplementorTBD
ReleaseTBD
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 threshold in 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) methodology. 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. While initially SIP-347 was considered as a primary solution, the proposed approach in this SIP specifically targets and mitigates the identified risk factor. Moreover, it streamlines the process of staking and unstaking in the v3 system, reducing friction associated with staking, since liquidation rate limit is considered to be a rare event.

Specification

The specification includes an update the requiredCredit function as shown below:

    function requiredCredit(uint128 marketId) internal view returns (uint) {
        return
            PerpsMarket
                .load(marketId)
                .size
                .mulDecimal(PerpsPrice.getCurrentPrice(marketId, PerpsPrice.Tolerance.DEFAULT))
                .mulDecimal(PerpsMarketConfiguration.load(marketId).lockedOiRatioD18)
                .mulDecimal(PerpsMarketFactory.lockedOiMultipleD18);
    }

Test Cases

  • Setting the lockedOiMultiple to 10,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)

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

Copyright and related rights waived via CC0.