The settle() function in GmxProxy.sol uses hardcoded values for critical price parameters without any slippage protection, potentially exposing users to significant losses during market volatility.
In the settle() function, several critical price-related parameters are hardcoded to either 0 or 1:
The issues are:
acceptablePrice: 0 - No maximum slippage limit
minOutputAmount: 0 - No minimum output guarantee
initialCollateralDeltaAmount: 1 - Hardcoded minimal value
This configuration means:
Orders can be executed at any price
No minimum received amount is enforced
Users have no protection against sandwich attacks or price manipulation
Severity: High
Likelihood: High (market volatility is common)
Impact: Critical (can lead to significant financial losses)
Potential attack scenarios:
MEV bots can sandwich the settlement transaction
During high volatility, orders could be executed at extremely unfavorable prices
No guarantee on minimum output amount could lead to significant value loss
Manual code review
Historical MEV attack analysis
Add slippage protection parameters to the OrderData struct:
Implement proper slippage checks in the settle() function:
Add proper validation:
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.