The SettlementConfiguration::requireDataStreamsReportIsValid
function uses block.timestamp
. The result is that others functions that expect valid data report may receive delayed report and in a more serious case, orders could be filled with an incorrect fillPriceX18
.
To fill market orders and off-chain orders, the order keeper should call SettlementBranch::fillMarketOrder
and SettlementBranch::fillOffchainOrders
functions respectively. Those functions set the bidX18
and askX18
prices of their contexts by calling the SettlementConfiguration:: verifyOffchainPrice
function which calls the SettlementConfiguration:: requireDataStreamsReportIsValid
function and returns the bid and ask prices from the verified premium report.
The SettlementConfiguration::requireDataStreamsReportIsValid
function uses block.timestamp
to checks if the provided data streams report is using the expected stream id, which could be manipulated by miners to a small degree, potentially allowing the use of delayed premium report if it is using the expected stream id.
Filling market orders and off-chain orders with wrong fillPriceX18
will lead to incorrect trading account values of pnlUsdX18
andorderFeeUsdX18
possibly making the protocol losing funds and so will do the traders.
Manual review.
Use a more robust timestamp source
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.