-
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]: Add tests for core pool joining logic (JoinPool
, CalcJoinPoolShares
, and joinPoolSharesInternal
)
#2346
Comments
AlpinYukseloglu
added
C:x/gamm
Changes, features and bugs related to the gamm module.
T:tests
labels
Aug 10, 2022
AlpinYukseloglu
changed the title
[x/gamm][StableSwap] Add tests for core
stableswap: Add tests for core Aug 10, 2022
JoinPool
, CalcJoinPoolShares
, and joinPoolSharesInternal
logicJoinPool
, CalcJoinPoolShares
, and joinPoolSharesInternal
logic
AlpinYukseloglu
changed the title
stableswap: Add tests for core
stableswap: Add tests for core pool joining logic (Aug 10, 2022
JoinPool
, CalcJoinPoolShares
, and joinPoolSharesInternal
logicJoinPool
, CalcJoinPoolShares
, and joinPoolSharesInternal
)
AlpinYukseloglu
changed the title
stableswap: Add tests for core pool joining logic (
[x/gamm][stableswap]: Investigate critical precision issue with binary search CFMM solver: Add tests for core pool joining logic (Aug 10, 2022
JoinPool
, CalcJoinPoolShares
, and joinPoolSharesInternal
)JoinPool
, CalcJoinPoolShares
, and joinPoolSharesInternal
)
AlpinYukseloglu
changed the title
[x/gamm][stableswap]: Investigate critical precision issue with binary search CFMM solver: Add tests for core pool joining logic (
[x/gamm][stableswap]: Add tests for core pool joining logic (Aug 25, 2022
JoinPool
, CalcJoinPoolShares
, and joinPoolSharesInternal
)JoinPool
, CalcJoinPoolShares
, and joinPoolSharesInternal
)
k derivation for tests: #1368 (comment) |
This was referenced Oct 16, 2022
Some multi-asset joins are blocked on precision increase in #3008 |
Repository owner
moved this from Needs Review 🔍
to Done ✅
in Osmosis Chain Development
Oct 16, 2022
Repository owner
moved this from Done ✅
to In Progress🏃
in Osmosis Chain Development
Oct 16, 2022
Repository owner
moved this from In Progress🏃
to Done ✅
in Osmosis Chain Development
Nov 5, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background
Our current implementation of stableswap does not have tests for the core logic related to pool joining. Most of the core logic is in
CalcJoinPoolShares
, so I focused my example test cases/categories mainly on that function. My suggestions below should get this core logic in the ballpark of what we have for our balancer tests, but we should still make an effort to cover as many additional edge cases as possible.Core logic to be tested:
osmosis/x/gamm/pool-models/stableswap/amm.go
Lines 377 to 405 in 08669da
Suggested Design
Core cases to test:
Specific things to test/errors to catch:
tokensin
(greater than 1, less than pool size should fail)CalcJoinPoolShares
updates pool state in stableswap, unlike our balancer implementation)CalcJoinPoolShares
(which just callsjoinPoolSharesInternal
), the number of tokens joined (both vs. expected amount and vs. actual tokens added to pool)Acceptance Criteria
joinPoolSharesInternal
show full coverageThe text was updated successfully, but these errors were encountered: