DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: high
Valid

Incorrect Update of Open Interest and Skew During Liquidations

Summary

In LiquidationBranch, function liquidateAccounts updates the perpetual market’s open interest and skew to zero which can lead to significant market discrepancies.

Vulnerability Details

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 liquidateAccountsfunction. Due to default value being 0, it's set to 0.

Impact

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.

Tools Used

Manual review

Recommendations

The protocol should calculate ctx.newOpenInterestX18and ctx.newSkewX18considering the liquidated position and then call updateOpenInterestwith new values.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`liquidateAccounts` calls `updateOpenInterest` with uninitialized OI and skew)

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.