SIP-297: Perps V2 - Fixes

Author
StatusImplemented
TypeGovernance
NetworkOptimism
ImplementorTBD
ReleaseTBD
ProposalLoading status...

Simple Summary

Improves the liquidation fees calculation, cleans delayed order event and object params, fixes the funding rate accrual computation and introduces a cap on the fees sent to liquidators for very large liquidations.

Abstract

SIP proposes 4 fixes:

  • (fix 1) zeroing unused params in delayedOrder object and and DelayedOrderSubmitted event, and
  • (fix 2) include position size in Liquidation Premium calculation,
  • (fix 3) replace .5 factor in Liquidation Premium calculation for an SCCP parameter, and
  • (fix 4) use fillPrice (p/d adjusted) to calculate Order Fee;
  • (fix 5) include price of asset in the funding accrual calculation

and an improvement:

  • (imp 1) adds a cap on the liquidation fee received by keepers on large liquidations.

Motivation

During the alpha release and operation we discovered some inaccuracies on the fees calculation and information of delayed orders (object and events) and after some simulations, discovered that for very large liquidations the liquidator will be rewarded with more than necessary where the excess can be redirected to the protocol and redistributed to stakers.

Specification

Overview

The fixes described in the Technical Specification solve an issue on the computation of the fees present on the current contract implementations.

Technical Specification

Fix unused params

Unused params targetRoundIdand executableAtTime should be zero in the delayedOrder object and DelayedOrderSubmitted event if the delayed order is off-chain (isOffchain: true).

Fix Liquidation Premium calculation

Use notionalValue (size * price) instead of price to calculate the liquidationPremium.

Fix Liquidation Premium calculation (2)

Remove the .5 factor when computing the liquidationPremium, and replace by an SCCP parameter.

Fix fee price using fillPrice (p/d adjusted)

Use the fill price (p/d adjusted price) to compute the fill price but still use oracle price (not adjusted) to compute liquidation price.

Fix funding accrual

Include the price of the asset when computing a positions' funding accrual. As part of this, we also increase maxFundingVelocity to 72 (from 3), wait 12hours, then lower back to 3.

Cap on liquidation fee sent to keeper

This improvement introduces a new configuration parameter (maxKeeperFee) that will be used to cap the fee sent to a keeper. This cap applies for large liquidations where the keeper fee can be of several thousand dollars. The excess is redistributed to stakers to reduce the impact on the debt. The parameter initially is set to 1,000 sUSD for all markets

Test Cases

NA

Configurable Values (Via SCCP)

  • maxKeeperFee: The maximum fee paid to liquidators
  • liquidationPremiumMultiplier: Multiplier applied in the calculation of the liquidation Premium

Copyright and related rights waived via CC0.