The contract should handle expired orders consistently across all functions to prevent manipulation and ensure fair trading.
Different functions have inconsistent behavior for expired orders: amendSellOrder
prevents modifications, buyOrder
prevents purchases, but cancelSellOrder
allows cancellation, creating an unfair advantage for sellers.
Likelihood:
When market conditions change unfavorably for sellers after order expiration
When sellers want to wait for better market conditions before retrieving their tokens
When buyers attempt to purchase expired orders at favorable prices
Impact:
Sellers can manipulate order timing by letting orders expire then cancelling when market moves against them
Buyers lose opportunity to purchase tokens at agreed prices due to seller manipulation
Market becomes unfair and trust in the protocol decreases
Market Manipulation Scenario: This demonstrates how sellers can exploit inconsistent expiration handling to manipulate market timing.
Explanation of Manipulation:
Alice creates a sell order at 100,000 USDC when market conditions are favorable
Order expires after 1 hour, but market price drops significantly
Dan sees the expired order at an attractive price and wants to buy
buyOrder
correctly prevents purchase of expired orders
However, cancelSellOrder
allows Alice to retrieve her tokens from expired orders
Alice benefits from asymmetric behavior: buyers can't buy expired orders, but sellers can cancel them
This creates unfair market manipulation where sellers can "wait and see" after expiration
In a fair system, expired orders should either be automatically fulfilled or become permanently unavailable
Why this works:
Ensures consistent behavior: if orders can't be bought after expiration, they can't be cancelled either
Eliminates seller advantage and manipulation opportunities
Creates fair market conditions for all participants
Expired orders become permanently inactive, requiring no further action
Alternative approaches to consider:
Auto-execution: Allow purchases of expired orders at a penalty rate
Grace period: Allow short window for cancellation after expiration
Liquidation mechanism: Automatically liquidate expired orders to a treasury
Partial fills: Allow buyers to partially fill orders before full expiration
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.