Avalanche recently changed its fee structure to make it more dynamic, which means that gas prices can fluctuate more frequently. Factors affecting gas prices include network congestion, increased network usage, and changes to the network's fee structure.
The positionExcutionFee in settle function method in gmxProxy contract calculates positionExecutionFee using tx.gasprice. However, Arbitrum and Avalanche use EIP-1559-style gas pricing, where tx.gasprice is not always accurate. On these chains, the gas price is dynamically determined as:
Effective Gas Price=block.basefee+tx.priorityFeePerGas
Since tx.gasprice may not reflect the correct execution cost, the contract may:
Overpay gas fees – reducing protocol efficiency.
Underpay execution costs – causing transactions to fail due to insufficient gas fees.
Instances \
Economic inefficiency: The contract overpay execution fees.
Execution failure risk: If the base fee fluctuates, the contract will fail to execute orders properly.
Not compatible with future gas optimizations in EIP-1559 chains.
manual review
Instead of using tx.gasprice use explicit base fee and priority fee calculations:
The frontrunner won’t trigger "congestion" without a huge amount of transactions, and it will cost a lot. Moreover, the execution gas limit is overestimated to prevent such cases: ``` executionGasLimit = baseGasLimit + ((estimatedGasLimit + _callbackGasLimit) * multiplierFactor) / PRECISION; ``` The keeper won’t wait long to execute the order; otherwise, GMX would not be competitive.
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.