QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: high
Invalid

Increase Precision in `lpTokenDepositValueChange` Calculations

Summary

The lpTokenDepositValueChange calculation currently lacks sufficient precision. To ensure accurate results, the precision of the computation should be increased.

Vulnerability Details

The calculation for lpTokenDepositValueChange is as follows:

localData.lpTokenDepositValueChange =
(int256(localData.lpTokenDepositValueNow) - int256(localData.lpTokenDepositValue)) /
int256(localData.lpTokenDepositValue);

This calculation is not performed using a fixed-point arithmetic approach, making it susceptible to precision loss, especially when the denominator is larger than the numerator—a common scenario.

Impact

Inaccurate lpTokenDepositValueChange calculations can lead to improper fee assessment, potentially disrupting the protocol’s ability to collect fees correctly.

Tools Used

Manual Review

Recommendations

use fixed-point arithmetic

Updates

Lead Judging Commences

n0kto Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.