A decimal precision error in the KeeperProxy._check()
function incorrectly normalizes token prices when comparing against Chainlink oracle prices. This causes the price validation to consistently fail, resulting in a complete denial of service for keeper operations that are essential for processing user orders.
The KeeperProxy._check()
function attempts to validate token prices by comparing them with Chainlink oracle prices. However, the decimal normalization logic is flawed:
Input prices are in 30 decimals
Chainlink prices are in 8 decimals
The current code attempts to normalize using:
For a token like WETH (18 decimals), this results in:
This leaves the price at 26 decimals instead of the intended 8 decimals, making it significantly larger than the Chainlink price and causing the validation to fail or incorrectly pass (there's a low chance of this happening).
Using ETH at $2000 as an example:
All keeper operations requiring price validation (run()
and runNextAction()
) will consistently fail
User orders cannot be processed as keepers are unable to execute them
This effectively breaks core protocol functionality, as position management becomes impossible
If the validation some how passes, it will lead to alot of price related issues such as wrong colateral, shares, and size delta calculatons which will scramble the protocols accounting and increase the risk exposure on GMX
Fix the decimal normalization by directly converting to 8 decimals:
This ensures prices are properly normalized to 8 decimals before comparison, allowing valid keeper operations to proceed.
GMX github documentation: “Prices stored within the Oracle contract represent the price of one unit of the token using a value with 30 decimals of precision. Representing the prices in this way allows for conversions between token amounts and fiat values to be simplified, e.g. to calculate the fiat value of a given number of tokens the calculation would just be: token amount * oracle price, to calculate the token amount for a fiat value it would be: fiat value / oracle price.” Sponsor confirmed the keeper does the same, so price decimals change in function of the token, to be sure the above rule is true. Example for USDC (6 decimals): Prices will have 24 decimals → 1e6 * 1e24 = 1e30. Just a reminder for some submissions: shortToken == collateralTokens, so the decimals is 1e24 for shortToken prices.
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.