The current swap implementation lacks explicit slippage protection, exposing the protocol to potential economic inefficiencies even when executed by a trusted keeper.
Intended Swap: 100
USDC → WETH
Expected Output: 0.05
WETH
Actual Received: 0.025
WETH
Loss: 50%
of expected swap value
Keeper executes swap at an economically unfavorable moment
No mechanism to prevent extremely poor swap rates
Absence of minimum output validation
AGI
function _doDexSwap(
bytes memory data,
bool isCollateralToIndex,
uint256 minExpectedOutput // <---
) internal returns (uint256 outputAmount) {
// Existing swap logic
}
Slippage and deadline are handled externally. Paraswap implementation used by the current code (behind the proxy): https://etherscan.io/address/0xdffd706ee98953d3d25a3b8440e34e3a2c9beb2c GMX code: https://github.com/gmx-io/gmx-synthetics/blob/caf3dd8b51ad9ad27b0a399f668e3016fd2c14df/contracts/order/OrderUtils.sol#L150C15-L150C33
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.