-
Notifications
You must be signed in to change notification settings - Fork 602
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] Figure out LP share amount out derivation for stableswap #1368
Comments
Can you provide more description for this issue ? |
Note: since our stableswap CFMM's constant does not scale linearly with pool assets like our balancer one's does, we cannot use the EDIT: It turns out for all-asset joins LP share calculation is completely independent from Leaving the calculations below in case we do need to eventually linearize General formulaThe general formula is: A more intuitive representation might be Examples:
DerivationTwo-asset CFMM: Multi-asset CFMM (derived example from 4-asset pool with assets x, y, m, and n): |
) Closes: #1368 (this is the last step left in LP share derivation) ## What is the purpose of the change This PR adds swap fee support for single asset joins. ## Brief Changelog - Factor in swap fees to single asset join input and truncate to int - Fix bug where joining then exiting could yield more tokens (specific fix: lower target for LP share binary search function by additive error tolerance so output is never greater than input) ## Testing and Verifying - The changes made in this PR are tested in `amm_test.go` under `TestCalcSingleAssetJoinShares` ## 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`? (no) - How is the feature or change documented? (not documented)
No description provided.
The text was updated successfully, but these errors were encountered: