Skip to content

rust: No panic when current time < last for quant and reclamm - #172

Merged
johngrantuk merged 3 commits into
rust-fix-5from
rust-fix-6
Aug 12, 2026
Merged

rust: No panic when current time < last for quant and reclamm#172
johngrantuk merged 3 commits into
rust-fix-5from
rust-fix-6

Conversation

@johngrantuk

@johngrantuk johngrantuk commented Aug 11, 2026

Copy link
Copy Markdown
Member

6. QuantAMM: unchecked subtraction on the weight-interpolation window

// quantamm_pool.rs, calculate_normalized_weights
let time_since_last_update = multiplier_time - last_update_time;

Underflows when current_timestamp < last_update_time, i.e. quoting at a block that precedes the
pool's last weight update — reachable during backfills and reorg handling. Same class as line 223 in
the reCLAMM table above.

Suggested fix: saturate, or return PoolError.

@johngrantuk
johngrantuk merged commit 822329b into rust-fix-5 Aug 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant