The OrderBook contract uses an insufficient precision factor (PRECISION = 100) for fee calculations, causing significant precision loss when computing protocol fees. The fee calculation protocolFee = (order.priceInUSDC * FEE) / PRECISION rounds down to zero for orders with values below 34 wei USDC (0.000034 USDC), effectively allowing free trading for small orders. This violates the intended 3% fee model and creates economic exploits.
Example calculation:
Protocol loses all fees on orders below 34 wei USDC
Intended 3% fee structure becomes inconsistent and exploitable
Increase precision factor:
Implement minimum fee protection:
Add minimum order value:
Implement proper validation:
These changes will ensure consistent fee collection, prevent zero-fee exploitation, and maintain the protocol's intended economic model.
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.