Potential precision loss due to integer division in MultiHopOracle._getData
When oracleConfig.invert is true, data is updated using integer division data = (data * 10 ** 18) / oracleRes. This can result in significant precision loss if oracleRes is larger than data, which can affect price feeds negatively, especially in multi-hop oracles.
https://github.com/Cyfrin/2024-12-quantamm/blob/main/pkg/pool-quantamm/contracts/MultiHopOracle.sol
If oracleRes is greater than data during an inverted hop, dividing by oracleRes will truncate the result, resulting in a less accurate price feed.
vscode
Use FixedPoint library or perform division as the last step of multiplication to better maintain precision in division operation.
Likelihood: Informational/Very Low, admin should use a price feed with 18 decimals and this feed should compare a assets with a very small value and an asset with a biggest amount to have the smallest price possible. Admin wouldn't do that intentionally, but one token could collapse, and with multiple hop, it increases a bit the probability. Impact: High, complete loss of precision. Probability near 0 but not 0: deserve a Low
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.