-
Notifications
You must be signed in to change notification settings - Fork 428
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
Stableswap #980
Milestone
Comments
Unit tests: |
Stableswap implementation: osmosis-frontend/packages/pools/src/stable.ts Lines 311 to 319 in 3a4ae28
Weighted implementation: osmosis-frontend/packages/pools/src/weighted.ts Lines 350 to 358 in 3a4ae28
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here are our final core stableswap functions:
The solver is the same for both and runs mostly boilerplate binary search on the CFMM, which is defined here (the comments about the solver function I linked in the third bullet point should explain its logic in detail) (edited)
Basically for Out Given In, we pass in a negative yIn to the solver (i.e. the “out” amount), which gives us the correct but negative output, which we have to negate
The text was updated successfully, but these errors were encountered: