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]: Implement maxNumAssets and maxTokensPerAsset to ensure multi-asset pools can't overflow #2827

Closed
Tracked by #1451
AlpinYukseloglu opened this issue Sep 22, 2022 · 0 comments · Fixed by #3055
Assignees

Comments

@AlpinYukseloglu
Copy link
Contributor

Background

Even with extremely generous precision bounds, since we're dealing with non-linear k values for our stableswap CFMM it will almost always be possible to trigger an overflow if we don't bound the number of assets and the number of tokens for each asset. We should implement maxNumAssets and maxTokensPerAsset and add related checks to all pool creation and swapping logic to ensure that CFMM inputs are bounded.

Suggested Design

  • Hard code maxNumAssets and maxTokensPerAsset to numbers that fit within our expected precision bounds. The specific numbers are TBD depending on the max number of assets we want to be able to accommodate in a single multi-asset pool

Acceptance Criteria

  • All existing tests pass
  • Error catching tests for out of bound inputs are added and pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
1 participant