After the private audit and fixing [L-03] the following changes introduced made the open interest and skew to be set to 0 after each liquidation, which will lead to confusion that the market is balanced but in reality it won’t be:
The intention of skew is so critical for a Market since it is used to balance the ratio of long/short positions in the system, by indicating what fees should be paid, calculating the price impact of order and calculating the current funding velocity.
After the fix from the previous audit newOpenInterestX18
and newSkewX18
are left unmodified and they will be their initial values - 0, this will reset the skew and OI after each liquidation, which will lead to wrong state of the market, resulting in direct loss of funds as well as being leveraged from a malicious actors. Main impacts are loss of funds due to fees for the protocol and wrong funding rates, which will cause loses for the LPs and long/short position holders, depending on the sign of funding rate.
Issue happens as there is no function that takes the current skew and OI in the LiquidationBranch::liquidateAccounts
.
Here is a POC prepared, which verifies that after liquidation both of the values are being equal to 0:
Direct loss of funds for protocol and traders, as well as wrong state of the Market, due to reseting the skew and OI on each liquidation.
Manual Review
Add the following lines to the LiquidationBranch::liquidateAccounts
:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.