delvtech / hyperdrive-rs

Rust SDK for the Hyperdrive AMM.
https://docs.rs/crate/hyperdrive-math/latest
Apache License 2.0
2 stars 0 forks source link

Max long & short failures in fuzz testing #136

Open dpaiton opened 3 weeks ago

dpaiton commented 3 weeks ago

Fuzz testing is seeing the following errors:

The fuzz pool is initialized to a known-good state (@slundqui is 80% certain it is good based on visual inspection of the parameters from himself, Jonny, & Alex and comparison against rust CI tests). Random bots make trades and call calc_max_long and calc_max_short at random times throughout.

dpaiton commented 3 weeks ago

possibly related: fuzz_calculate_max_short is failing with large differences in budget amount: https://github.com/delvtech/hyperdrive-rs/issues/121

This is happening rarely, but I believe that is because the test itself is rarely hitting the assert. I rewrote the test to always hit the assert and it fails much more often.