QuantAMM

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

lack of input sanitization breaks MomentumUpdateRule weight calculation

Summary

In the MomentumUpdateRule, kappa serves as a measure of aggressiveness. With a scale of [-1, 1], scenarios may arise where the kappa vector has values that sum to 0 despite containing both positive and negative values.

Example with 4 kappa values:

  • [-0.5e18, 0.25e18, 0.2e18, 0.05e18]

While each value individually satisfies the expected range, a sum of 0 introduces calculation errors in the system.

Impact

A kappa vector summing to 0 causes broken calculations in the MomentumUpdateRule.

Tools Used

Manual review.

Recommendations

Use the absolute value for kappa to avoid summation issues:

++ absolutekappa[i] = !(kappa[i] > 0) ? -(kappa[i]) : kappa[i];
Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas / Admin is trusted / Pool creation is trusted / User mistake / Suppositions

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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

Give us feedback!