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/gamm][stableswap]: Make scaling/descaling logic also convert to and from BigDec #2903

Closed
Tracked by #1451
AlpinYukseloglu opened this issue Sep 29, 2022 · 1 comment · Fixed by #2908
Closed
Tracked by #1451
Labels
C:stableswap C:x/gamm Changes, features and bugs related to the gamm module.

Comments

@AlpinYukseloglu
Copy link
Contributor

Background

Scaling/descaling can serve as a convenient place to convert inputs and outputs to/from BigDec for core stableswap math. Once we make this change, we should ensure that the only conversions to and from BigDec happen through the scaling functions.

Suggested Design

  • Make scaling functions do SDKDec -> BigDec and descaling do BigDec -> SDKDec

Acceptance Criteria

  • All conversions to and from BigDec happen under scaling functions
  • All existing and new tests pass
@AlpinYukseloglu AlpinYukseloglu added C:x/gamm Changes, features and bugs related to the gamm module. C:stableswap labels Sep 29, 2022
@osmo-bot osmo-bot moved this to Needs Review 🔍 in Osmosis Chain Development Sep 29, 2022
@AlpinYukseloglu
Copy link
Contributor Author

It just occurred to me that this might not be fully possible since we directly interact with the PoolI interface for single asset joins @ValarDragon

Am I right in assuming that if we want to use scaling/descaling functions to gate SDKDec <-> BigDec conversions (and do all internal calculations with BigDec), we would have to create a BigDecCoin implementation and an internal pool interface that supports it?

@osmosis-labs osmosis-labs deleted a comment Sep 30, 2022
Repository owner moved this from Needs Review 🔍 to Done ✅ in Osmosis Chain Development Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:stableswap C:x/gamm Changes, features and bugs related to the gamm module.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants
@AlpinYukseloglu and others