There is a fucntion GmxProxy::getMarketPrices which supposed to retriving the prices through GMX::Oracle is not handled or used properly which could lead to DOS the whole protocol.
So this function is retriving the prices through the GMX oracle on chain to use it later. So this function first retrieving the retriving oracle address from the orderHandler. To fetch the price from direcly Oracle (`0xb8fc96d7a413C462F611A7aC0C912c2FE26EAbC4`) but the price is not updated in the Oracle so it always returns 0. (As the price is not updated).
There is actually 2 orderHandler address which used in protocol, both result to same oracle address.
OrderHandler (According to test) contracts/test/PerpetualVaultTest
OrderHandler (According to scripts) contracts/scripts/deploy/1_deployGmxProxy.js
So as this return 0, this function has a check actually which revert with the error EmptyPrimaryPrice(token) always,which hasn't handelled or checked properly in GMXProxy::getMarketPrices
It always going to revert with Error whenever protocol try to open position which basically make it DOS.
So the work flow opening the position is
Gamma Keeper use run funtion to create a request in GMX perpertual to open a position
Once the order is executed by GMX keeper, GMX is going to call back to GMXProxy::afterOrderExecution
This function use GMXProxy::getMarketPrices to retrive the price.
As explained above this function is broken so it's always revert
Manual Review
Copy this function in test/PerpetualVaultTest
Output:
Revert with the same error
Use another way to fetch prices as this is not working
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
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.