The OrderBook contract's buyOrder
function lacks validation to prevent sellers from buying their own orders. This oversight enables wash trading, a form of market manipulation where the same entity acts as both buyer and seller in a transaction to create artificial market activity.
Likelihood: High
Sellers have a direct financial incentive to engage in wash trading to manipulate market perception.
The protocol has no mechanisms to detect or prevent this behavior.
Wash trading is a common practice in unregulated markets where it's not explicitly prevented.
Impact: Medium to High
Artificial trading volume can mislead other users about the actual liquidity and demand for assets.
Wash traders can manipulate price discovery mechanisms and market sentiment.
The protocol's reputation could be damaged when wash trading is discovered.
The protocol collects fees from wash trades, potentially creating misleading revenue metrics.
The following test case demonstrates how a user can engage in wash trading by buying their own sell orders:
The Wash Trading Process:
Alice creates a sell order for 1 WETH at a price of 2000 USDC
Instead of waiting for another trader, Alice buys her own order
The contract allows this transaction to proceed without any restrictions
Token Flow Analysis:
Alice initially transfers 1 WETH to the contract when creating the sell order
When buying her own order, Alice transfers 2000 USDC (split between herself and protocol fees)
Alice receives back her original 1 WETH
Net result: Alice essentially paid only the protocol fee (60 USDC) while creating fake trading volume
Market Manipulation Implications:
This activity creates an illusion of market activity and liquidity where none exists
The recorded trading volume is artificial and misleading to other market participants
The transaction appears as legitimate trading activity in the protocol's history
Protocol Impact:
The protocol earns fees from wash trades, potentially creating misleading revenue metrics
Trading volume statistics become unreliable for measuring actual market interest
Market participants may make trading decisions based on artificial activity
Add a simple check to prevent sellers from buying their own orders:
Additionally, add the new error:
This simple check prevents the most basic form of wash trading where a single address acts as both buyer and seller. However, it's worth noting that more sophisticated wash trading involving multiple colluding addresses would require additional off-chain monitoring and analysis.
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.