every time liquidateAccounts() is executed the market's openInterest/skew is cleared to 0 by error
in liquidateAccounts()
We will update the openInterest/skew of the market.
The method ends up executing perpMarket.updateOpenInterest(ctx.newOpenInterestX18, ctx.newSkewX18);
The problem is: ctx.newOpenInterestX18, ctx.newSkewX18 is not calculated, it is always 0
So after updateOpenInterest() the market's openInterest/skew will be set to 0
openInterest/skew is cleared to 0, causing any calculations that depend on these two variables to be wrong
For example
openInterest is cleared, fillOrder()->checkOpenInterestLimits()->openInterest - oldPositionSize may underflow , order execution fails
skew is cleared, getMarkPrice() is miscalculated.
... etc.
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.