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]: Ensure rounding is properly handled for all scaling operations #2898

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

Comments

@AlpinYukseloglu
Copy link
Contributor

Background

Given how we scale/descale both pool reserves and token inputs/output, there isn't a single way to handle scaling-related rounding that works for all core functions (mainly pool joins, pool exits and swaps). We need to ensure that all of these operations are handled properly + have tests that help us build confidence that they are correct.

Suggested Design

  • See scaling factor rounding section here: https://hackmd.io/n3OpsedfSMWGNkPsqZlvrA
  • At a bare minimum, we should test that mirrored operations with zero swap fee yield the same output (e.g. for swaps: swap foo to bar and then back to foo (expect same amount of foo) and for pool joins: join and exit a pool (expect same amount of assets)

Acceptance Criteria

  • All new and existing 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

Closed by #2908

Repository owner moved this from Needs Review 🔍 to Done ✅ in Osmosis Chain Development Oct 19, 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

No branches or pull requests

1 participant