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

[stableswap]: Convert all core stableswap arithmetic to use BigDec #2777

Merged
merged 6 commits into from
Sep 19, 2022

Conversation

AlpinYukseloglu
Copy link
Contributor

Closes: #2776

What is the purpose of the change

This PR updates all core arithmetic operations in stableswap to use our BigDec type instead of the regular sdk.Dec type.

Brief Changelog

  • Update all uses of sdk.Dec for internal calculations to use BigDec
  • Add methods for converting from sdk.Dec to BigDec and vice versa to our BigDec implementation

Testing and Verifying

  • The core change is currently a trivial refactor as sdk.Dec and BigDec have the same precision, but this change will require more thorough testing once we increase precision bounds in BigDec
  • The conversion methods for sdk.Dec <-> BigDec only have basic sanity tests, as testing them more thoroughly requires finalizing the specific decimal precision we want for BigDec (left for a future PR to not block this one)

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 05:20
@github-actions github-actions bot added the C:x/gamm Changes, features and bugs related to the gamm module. label Sep 19, 2022
@AlpinYukseloglu AlpinYukseloglu changed the title [stableswap]: Convert all core stableswap arithmetic to use bigdec [stableswap]: Convert all core stableswap arithmetic to use BigDec Sep 19, 2022
osmomath/decimal.go Outdated Show resolved Hide resolved
osmomath/decimal.go Outdated Show resolved Hide resolved
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.

[stableswap]: Convert all core stableswap arithmetic to use bigdec
4 participants