The SettlementBranch::fillMarketOrder(...)
function lacks slippage protection against price shifts.
The SettlementBranch::fillMarketOrder(...)
function fetches the price from off-chain reports provided by Chainlink Data providers and uses the provided price without checking for price slippage. For instance, at the time of creating the order, the price of ARB-USD
might be $1 USD
. However, if the price shifts to $0.8 USD
when SettlementBranch::fillMarketOrder(...)
is called, the trade will execute at this new price, which might be undesirable for the user.
This protection is implemented in the SettlementBranch::fillOffchainOrder(...)
function:
There might also arise a condition when the fill price leads to the decrease in the markPrice
and difference between marPrice - lastInteractoinPrice
is negative which might cause loss to the user.
The trade might be executed at an undesirable price and the trader might incur losses.
Manual Review
Foundry
It is recommended to include slippage protection in the SettlementBranch::fillMarketOrder(...)
function.
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.