[Proposal] Use TWAP for pre and after market oracle price for liquidation

In general, I think the goal should be to liquidate as minimal as possible with an insurance fund from the platform in extreme case of negative asset prices, this is the way f.e. FTX.com operates. You can also hold the long holders accountable for liquidations of the shorters when in negative net asset territory. TWAP, Time Weighted Average Price; take the average and f.e. cut out 10% extremes on either side to prevent random spikes during pre- and after-market of thin trade. And make this volume dependent, single to under 1k trade size can sometimes be outliers. This should be easy since oracle usually have OHLCV per timestamp (open, high, low, close, volume) and you can calculate the average volume of the last day to know what is low volume.

Because I see no disadvantage in having to require more confirmation ways before having the liquidation mechanism trigger, since collateral is 130%+ and we are looking at multi billion assets we have some room before holders actually dive below zero.

Another improvement would be to allow something like kujira to place liquidation orders and not have first come first serve mechanism on the bidding. This creates an open and transparent system, and not gaswars to get the first fill for a liquidation. Also this will bring down the average discount rate I expect since the retail liquidation market is more competitive.

The current situation is too risky for both short and neutral farms to be holding any short position. Price spikes occur simply too often to be an absolute anomaly and claiming that such a signal is ‘real’ when it is questionable whether it could have been traded with a limit order is just too easy.


I strongly support this.We should do it as soon as possible.

Liquidations auction-style (a la Anchor) as opposed to first-come/first-served would be a clear improvement to the protocol but revisiting the way the real world asset’s price is contributed by the Oracles is probably higher priority.

For the latter, I basically see 2 options:

  • try and identify some edge cases and filter them out like you suggested
  • more likely, simply disable the oracle for pre/post-market

What do you guys think?


How do liquidations work on mirror? I can’t find details about it and I’d like to review the process or even participate if its possible. Can someone point me in the right direction?

1 Like

I strongly support this. However, is there an even quicker fix to the after hours pricing issue we can execute in the interim?

1 Like

There is the code of liquidation.

1 Like

Just disabling pre- and after-market oracle would be a good solution to start with and then the team can take their time to come up with an improvement to enable it back with perhaps some constraints.