-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
We have a few functions associated with calculating the absolute max short:
calculate_max_short_upper_bound --> max only considering yieldspace curve
absolute_max_short_guess --> one-shot approximation to the Hyperdrive pool's max short (incl fees & solvency reqs)
calculate_absolute_max_short --> iterative method for refining pool's absolute max short guess
They all seem to have some problems.
calculate_max_short_upper_boundfails this test:
- tolerance = some small value (ideally zero)
- initialize & trade to a random state on-chain
- ys_max = state.calculate_max_short_upper_bound()
- celine.open_short(ys_max)
- new_max = state.calculate_max_short_upper_bound()
- assert!(new_max <= tolerance)
I'm seeing failures with tolerances on the order of 1e36.
-
absolute_max_short_guessdoes not always a return solvent result -
calculate_absolute_max_shortoften throws errors from insolvent guesses, resulting in many tests having to catch panics and errors whenever using the function.
Metadata
Metadata
Assignees
Labels
No labels