In LiquidationBranch
, function liquidateAccounts
updates the perpetual market’s open interest and skew to zero which can lead to significant market discrepancies.
The function perpMarket.updateOpenInterest(ctx.newOpenInterestX18, ctx.newSkewX18)
is intended to update the perpetual market’s open interest and skew during liquidations without enforcing caps. However, these values are not calculated in liquidateAccounts
function. Due to default value being 0
, it's set to 0
.
If any of the account gets liquidated, the perp markets corresponding to the account's position will have skew and open interest updated to 0
. This will cause market imbalance which will affect all participants of the affected perp markets.
Manual review
The protocol should calculate ctx.newOpenInterestX18
and ctx.newSkewX18
considering the liquidated position and then call updateOpenInterest
with new values.
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.