When Product is closed, then liquidation is not allowed
Summary
When Product is closed, then liquidation is not allowed. Positions that will be underwater will not be closed by their owners which will make losses for another traders.
Vulnerability Detail
Product contract can be closed by the coordinator. When this is done, then the only option that is enabled to users is to close their positions, because everything else uses notClosed modifier.
That means that once product will be closed, then liquidations will not be allowed as well.
However it's not guaranteed that user's will close their positions immediately, so they can become underwater and no one will liquidate them.
Impact
Underwater positions can't be liquidated
Code Snippet
Provided above
Tool used
Manual Review
Recommendation
Allow liquidation after closing product, as liquidation closes position as well.
rvierdiiev
medium
When Product is closed, then liquidation is not allowed
Summary
When Product is closed, then liquidation is not allowed. Positions that will be underwater will not be closed by their owners which will make losses for another traders.
Vulnerability Detail
Product
contract can be closed by the coordinator. When this is done, then the only option that is enabled to users is to close their positions, because everything else usesnotClosed
modifier.What we need to check is that
closeAll
function also can't be called when product is closed. This function is used byCollateral
contract in order to liquidate account.That means that once product will be closed, then liquidations will not be allowed as well. However it's not guaranteed that user's will close their positions immediately, so they can become underwater and no one will liquidate them.
Impact
Underwater positions can't be liquidated
Code Snippet
Provided above
Tool used
Manual Review
Recommendation
Allow liquidation after closing product, as liquidation closes position as well.