Users can withdraw up to maintenance margin when they shouldn't be able to
Whenever a user creates a market order, there is this piece of code:
The comment says that if the position is under the initial margin and is over the maintenance margin, the user can decrease their position based on the maintenance margin. The issue is that if the user is above the initial margin, he can still decrease his position up to the maintenance margin as there is no checks disallowing that.
Users can withdraw up to maintenance margin when they shouldn't be able to
Manual Review
If the user is above the initial margin, shouldUseMaintenanceMargin
should be false
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.