-
Notifications
You must be signed in to change notification settings - Fork 607
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
Fix second source of (minor) over-LP shares #1716
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far. Are we just working on a unit test for this?
yeah we just need unit tests |
Working on unit tests and more comments here: #1721 |
I think we should merge this and review #1721 separately. What do you all think? |
Should #1723 be address in this PR as well? |
IMO, it's definitely a fix that we need but not with this PR since stableswap is a completely different component |
Going to add a changelog entry and merge. Unit tests are coming in:
|
* Fix insufficient total share creation * More correctx * changelog entry Co-authored-by: Roman <[email protected]> (cherry picked from commit 089ce41)
What is the purpose of the change
Another bug, spotted by samczun. Not caught in tests, because it occurs on uneven swap amounts.
For uneven swap amounts, we tend to have tokens remaining after doing an equal ratio swap. For each of the tokens, we do a single asset pool join.
The logic was broken in providing the correct number fo shares for single asset joins. This PR fixes it.
This change added tests and can be verified as follows:
CalcJoinPoolShares
with uneven swap amounts: chore: additional test cases for TestCalcJoinPoolShares (multi-coin swap) #1713Documentation and Release Note
Unreleased
section inCHANGELOG.md
? yes