-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: larger gamma #12
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… are the same as before now
In `ImbaalncedLiquidiytStateful` we start claiming admin fees, which can sometimes break the virtual price invariants.
After a long fight to get some reasonable tests to pass on this one, it feels almost out of scope to check so many conditions inside stateful testing. The pool can fail depending on too many parameters which make the test very tedious to write. Might come back to this in a later time but will leave a simpler check for now.
This reverts commit 5d02dbf.
This reverts commit 6bfb071.
Before cases where one of the amounts was 0 would not run
restored imbalanced liquidity based on a percentage like it used to before, with a stricter limit on the imbalance, and created one more rule for fully imbalanced deposits.
assumption should be checked only if amount is non-zero
Testing managed to get an overflow with a number that was very close to one.
Added a list of presets that will be expanded in the future. This helps keep testing sane since drawing random parameters for the pool finds edge cases that are not relevant to production pools.
We only use decimals that we have actually seen in production
Refactored the pool strategy so that we can build a strategy that samples params from presets on top of it.
Goal is to remove as many assertions as possible as they hurt testing.
One coin deposits are already handled by `add_liquidity_imbalanced`.
Prices now don't go too low with the decimals because testing for shitcoins is not the goal here.
bout3fiddy
approved these changes
Jun 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Very good work with reworking the tests and indeed not going to arbitrary A, gamma way definitely was the better approach.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Features implemented
MAX_GAMMA_SMALL
0.02 (as before) and even allow to go as far asMAX_GAMMA
0.199 with some more restrictive checks on convergence.newton_D
convergence limits are now symmetric.Testing
strategies.py
now contains a collection ofSearchStrategy
that can be used for stateful testing (and fuzzing) instead of fixtures, to unlock all the hypothesis features (like statistics and shrinking) that were previously unavailable with injected pytest fixtures.fuzz_multicoin_curve
(nowsimulator.py
) toutils
since it's not a proper test, but rather a simulation helper to find bounds. Lots of dead code has been removed.