The createOrder function transfers ETH to the GMX order vault to cover the execution fee, but there is no mechanism to refund the fee if the order fails or is canceled. When an order is created, the contract calculates the gas fee required and sends it to GMX:
However, if the order fails (e.g., due to slippage, insufficient liquidity, or GMX execution errors), the execution fee remains locked within the GMX system and is not refunded to the perpetual vault or the proxy contract. This leads to a gradual drain of ETH balance over multiple failed or canceled orders, increasing operational costs and reducing efficiency.
The primary impact is a loss of ETH from the contract due to unclaimed execution fee refunds, leading to unnecessary capital inefficiency and potential vault insolvency if excessive fees are lost over time.
Implement a refund mechanism that calls refundExecutionFee()
whenever an order is canceled or fails, ensuring that unused gas fees are returned to the perpetual vault or the proxy.
Order is not executed, those fees can be used for the next retry.
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.