The MarketUtils library contains a critical issue in its collateral calculation logic, where it incorrectly uses shortTokenPrice for all collateral calculations, regardless of whether the position uses longToken or shortToken as collateral. This can lead to incorrect position valuations and trigger false liquidations.
The root of the problem is that the willPositionCollateralBeSufficient function always uses shortTokenPrice for collateral calculation without considering that the collateral can be longToken or shortToken which can lead to incorrect collateral value calculation.
If a position uses longToken as collateral, the collateral value will be incorrect due to the incorrect price being used. This can cause the position to appear under-collateralized when it is not.
False liquidations of healthy positions
Incorrect margin calculations
User opens a long position using longToken (e.g., ETH) as collateral
Market price of longToken increases significantly
System calculates collateral value using shortTokenPrice (e.g., USDC)
Position appears under-collateralized due to incorrect price usage
Position gets wrongfully liquidated despite having sufficient collateral value
Example:
Manual review
Implement proper collateral price selection logic.
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.