This repository has been archived by the owner on Sep 24, 2023. It is now read-only.
IllIllI - Liquidation shouldn't be used to close positions that were fully-collateralized prior to collateral requirement changes #179
Labels
Medium
Reward
A payout will be made for this issue
Sponsor Confirmed
Won't Fix
The sponsor confirmed this issue will not be fixed
IllIllI
medium
Liquidation shouldn't be used to close positions that were fully-collateralized prior to collateral requirement changes
Summary
There are various factors associated with minimum collateral requirements, and if a position falls below them, the position is liquidated.
Vulnerability Detail
If the position was over-collateralized and in profit prior to the change in the minimums, and the minimum is increased, the position is liquidated.
Impact
Liquidation gives all funds to the pool, giving nothing back to the user
Code Snippet
A position becomes liquidatable once it falls below the changeable collateral requirements:
https://github.com/sherlock-audit/2023-02-gmx/blob/main/gmx-synthetics/contracts/position/PositionUtils.sol#L368-L388
Liquidations give everything to the pool, and nothing to the position's account
Tool used
Manual Review
Recommendation
Close the position with a market order, rather than liquidating it, if the user was previously above the minimum with the old factor
The text was updated successfully, but these errors were encountered: