Fee Calculation Precision Loss + Revenue Impact
The protocol is designed to collect a 3% fee on all order transactions to generate revenue for the platform.
The fee calculation uses integer division which rounds down, causing small orders to result in zero fees and allowing users to bypass protocol fees entirely, leading to significant revenue loss.
Likelihood:
Users frequently place small orders in DeFi protocols, especially for testing or small trades
Attackers can deliberately structure transactions to minimize fees through precision loss exploitation
Impact:
Protocol loses significant revenue from small orders that should generate fees but result in zero due to rounding
Users can exploit the rounding behavior to trade without paying fees by keeping order values below fee threshold
Unfair fee distribution where large orders pay proportionally more while small orders pay nothing
Potential for systematic fee avoidance through order splitting strategies
The integer division rounding issue can be demonstrated with specific order values that result in zero fees:
Zero Fee Examples: Orders with priceInUSDC
values that result in zero fees due to rounding down:
Fee Avoidance Attack: Malicious users can exploit this by splitting large orders into smaller ones:
Implement minimum fee requirements and consider using higher precision calculations to reduce the impact of integer division rounding or an alternative Solution higher precision
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.
Appeals are being carefully reviewed by our judges.