If a user creates a market order and realizes it was incorrect, they cannot cancel it before the marketOrderMinLifetime
of 10 seconds has passed but the markedOrder can be executed during this cool down period
. The inability to cancel an incorrect order promptly can lead to unintended order executions, potentially causing financial losses for the user.
The OrderBranch
contract includes a function cancelMarketOrder
that allows users to cancel their market orders. However, this function includes a check marketOrder.checkPendingOrder()
which enforces that a market order cannot be cancelled before it has existed for the minimum order lifetime of 10 seconds.
According to the team, during this 10 second, the order can be executed which can lead to unintended order filling.
Example:
A user creates a market order.
The user realizes the order was incorrect and attempts to cancel it immediately.
The cancelMarketOrder
function reverts due to the marketOrder.checkPendingOrder()
check.
The market order remains active and is executed within the 10-second window, even though it could have been cancelled.
The filling of the order leads to unintended financial consequences for the user.
Remove the marketOrder.checkPendingOrder()
check from the cancelMarketOrder
function to allow users to cancel their market orders immediately, regardless of the minimum order lifetime.
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.