The protocol should collect a 3% fee on all transactions to generate revenue for the platform.
The fee calculation uses integer division which rounds down to zero for small transactions, causing the protocol to lose fee revenue on orders below a certain threshold.
Likelihood:
When users place orders with priceInUSDC
values less than 34 USDC (since 33 * 3 / 100 = 0)
When the contract is used for micro-transactions or testing with small amounts
When users deliberately place many small orders to avoid fees
Impact:
Protocol loses fee revenue on a significant portion of small transactions
Users can exploit this by splitting large orders into many small fee-free orders
Economic model of the protocol becomes unsustainable for small-value trading
Fee Avoidance Exploit: This demonstrates how users can avoid protocol fees by splitting large orders into many small ones.
Mathematical Breakdown:
Fee calculation: protocolFee = (priceInUSDC * 3) / 100
For 33 USDC: (33 * 3) / 100 = 99 / 100 = 0
(integer division rounds down)
For 34 USDC: (34 * 3) / 100 = 102 / 100 = 1
(first value that generates fee)
By splitting 330 USDC into 10×33 USDC orders, user pays 0 fees instead of 9.9 USDC
This represents a 100% fee avoidance on substantial transaction volume
Why this works:
Guarantees minimum revenue of 1 USDC per transaction regardless of order size
Eliminates fee avoidance through order splitting strategies
Maintains percentage-based fees for larger orders while protecting against small order exploitation
Simple implementation that doesn't require complex precision arithmetic
Alternative approaches:
Higher precision: Use basis points (10000) instead of percentage (100) for more granular fees
Minimum order size: Require orders above a certain threshold (e.g., 100 USDC minimum)
Tiered fee structure: Different fee rates based on order size brackets
Gas + percentage: Combine fixed gas cost coverage with percentage fees
Protocol Suffers Potential Revenue Leakage due to Precision Loss in Fee Calculation
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.