The liquidateAccounts
function updates openInterest
and skew
to 0
due to uninitialized values, leading to incorrect calculations.
At the end of the liquidateAccounts
function, perpMarket.updateOpenInterest
is called to update the skew and the open interest of a given perpetual market:
The issue is that both ctx.newOpenInterestX18
and ctx.newSkewX18
are never initialized at this point in the function. Therefore the skew and open interest will get updated to 0
:
This issue will lead to wrong fee and mark price calculation (because the skew is involved) and prevent checking the open interest and skew max limits during settlement.
Manual Review.
You could either use checkOpenInterestLimits
(try) to get these values or manually calculating them (catch). The problem with checkOpenInterestLimits
is that it checks against open interest and skew limits which could prevent some liquidations so I would not recommend using it.
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.