Based on the docs and GMX V2 code, output token from ADL order can be unwrapped ETH which is not handled in the current implementation.
From https://github.com/gmx-io/gmx-synthetics?tab=readme-ov-file#integration-notes:
Accounts may receive ETH for ADLs / liquidations, if the account cannot receive ETH then WETH would be sent instead
In AdlUtils::createOrder()
(reference), we can see that shouldUnwrapNativeToken
is set to true
, which will result in sending the native token to the position account later in transferOut()
(reference). Additionally, since GmxProxy
implements a receive()
functionality, it can receive ETH instead of WETH.
The following snippet in GmxProxy.sol
aims to handle ADL scenario and send funds to PerpetualVault
, but it does not account the scenario mentioned above.
Stuck tokens + loss of funds for depositors.
Manual review.
Consider checking if output token is ETH and swap it to collateral token or wrap it when received so it will be swapped like it is done before every every action.
`TokenUtils.sol::sendNativeToken()` has no reason to fail since there is a `receive` function without any instruction in the GmxProxy. It’s the simpliest and cheapest transfer possible. Good finding, but there is no likelihood.
Impact: High, native ETH is sent to Gamma and won’t be accounted or withdrawn with the shares. Lead to revert of the transfer in the proxy. Likelihood: Low/Medium: Happen during ADL order (too many PnL), only on WETH/USDC market.
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.