The protocol allows a short order to be partially matched, generating a short record for the matched amount. The unmatched portion of the order can be subsequently filled and added to the short record.
A short record is flagged if it falls below the primary liquidation ratio set by the protocol, signalling to the user that their position is nearing an unhealthy state. The user can resolve this by modifying the position to improve its health or by paying off the short and exiting the position.
If a user is unable to get their their position to a healthy state by a certain time they can be liquidated.
A vulnerability exists where, under specific circumstances, a user’s healthy position is flagged and can be instantly liquidated without warning.
Consider the following scenario
User A creates a short order, 50% of which is filled with a bid.
User A’s position falls below the primary liquidation ratio and is flagged by User B.
User A’s position is fully liquidated by User B, with the flag remaining active post liquidation.
The remaining order gets filled at a healthy ratio but remains flagged.
A healthy short is incorrectly flagged.
If the new short falls below the primary liquidation ratio:
It cannot be flagged by another user until updatedAt (when short was filled) plus the reset time is reached.
It can be liquidated after updatedAt (when short was filled) plus the firstLiquidationTime till resetLiquidationTime even if it was never flagged.
Keep in mind the shorts updatedAt will be updated when the short gets filled so this will push the liquidation times up by the time diff (fillShort - flagged).
A user is also unable to use certain protocol functionality (e.g. transfer the short).
Manual Analysis
Foundry
The liquidation process must reset the flag in full liquidations to ensure that users don’t start off with healthy positions flagged when the unmatched portion gets filled.
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.