Skip to content
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

[x/stableswap]: Increase precision of osmomath BigDec to prevent stableswap CFMM precision issues #2778

Merged
merged 5 commits into from
Sep 19, 2022

Conversation

AlpinYukseloglu
Copy link
Contributor

Closes: #2591

What is the purpose of the change

This PR (finally!) fixes all the precision-related issues we have with our stableswap CFMM. I haven't checked exact bounds yet, but our binary search solver was able to comfortably support trillion token asset pools with this change.

A large part of the diff is #2777, which this PR branches off of.

Brief Changelog

  • Increase max bitlen from 512 to 1024
  • Increase max decimal precision from 18 to 36
  • Update all related tests to correctly reflect the new bounds

Testing and Verifying

  • All the tests in osmomath/decimal_test.go and osmomath/int_test.go should be up to date with the new bounds

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? (no)
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? (yes / no)
  • How is the feature or change documented? (not documented)

@AlpinYukseloglu AlpinYukseloglu requested a review from a team September 19, 2022 07:49
@github-actions github-actions bot added the C:x/gamm Changes, features and bugs related to the gamm module. label Sep 19, 2022
osmomath/decimal.go Outdated Show resolved Hide resolved
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/gamm Changes, features and bugs related to the gamm module.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[x/stableswap][osmomath] Increase precision of osmomath BigDec to 36 prevent stableswap CFMM precision issues
2 participants