Synthetixio / issues

0 stars 3 forks source link

[TASK] Futures: short term liquidations improvements #352

Closed artdgn closed 2 years ago

artdgn commented 2 years ago

Context: this are the short term tasks that came of a discussion of notion doc on futures liquidations problems and ideas

These improvements should be prioritised to be done before mainnet-OVM launch in order to reduce risk to protocol stakers during periods of high volatility (short term mitigation):

  1. [x] Proportional liquidation fee: Modify the liquidation fee (incentive) to be proportional to position size (instead of current constant fee) in order to incentivize liquidating larger (more risky) position before smaller positions. Should be something like max(minFee, feePercent * positionSize), with feePercent being some small percentage (e.g. 1%).

  2. [x] Negative margin buffer: Add an additional buffer to liquidation price check to prevent negative margin situation in which protocol stakers pay for the liquidation. Something like liqPriceBufferPercent of e.g. 1% that adjusts liquidation price. Another possible alternative is to withold the liquidation fee from margin upon opening, but that would mean that it would need to be updated when price changes - so the percentage calculation may be simpler.

  3. [ ] Multiple past oracle prices check: When checking if position can be liquidated on-chain (e.g. when user is trying to close / update his position) multiple past oracle prices should be checked in order to reduce possibility of closing position that should have been liquidated. Add configurable parameter of nPastPrices to check, so that the tradeoff between gas efficiency and risk can be updated with time.

jacko125 commented 2 years ago

Note: Update SIP-80 once we start implementation on the proportional liquidation fee and margin buffer (for liquidation fee).

artdgn commented 2 years ago

Maybe do https://github.com/Synthetixio/issues/issues/363 as part of this.

artdgn commented 2 years ago

https://github.com/Synthetixio/synthetix/pull/1594 adds proportional liquidator fee and proportional buffer.