DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Trader is unable to close the position if it is too small

Summary

Trader won't be able to close his position and later withdraw the collateral, because of this check. This check is present both in OrderBranch and SettlementBranch.

perpMarket.checkTradeSize(ctx.sizeDeltaX18);

Vulnerability Details

Such situation might happen in two scenarios:

scenario 1:

  • Trader opens position with double the size of minTradeSizeX18

  • Trader closes 75% of the position

  • Trader tries to close the remaining but he's unable, since his position is only 50% of minTradeSizeX18

scenario 2:

  • Trader opens position with double the size of minTradeSizeX18

  • System administrator makes minTradeSizeX18 three times bigger

  • Trader is unable to close the position

Impact

Some of the trader founds might be locked.

Tools Used

Manual Review

Recommendations

Do not enforce this limit when the trader is trying to exit the position

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!