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] cfmm solver calculates incorrect value #2819

Closed
pysel opened this issue Sep 22, 2022 · 1 comment
Closed

[stableswap] cfmm solver calculates incorrect value #2819

pysel opened this issue Sep 22, 2022 · 1 comment

Comments

@pysel
Copy link
Member

pysel commented Sep 22, 2022

While working on 2346 faced invalid output: greater than full pool reserves. I used pool with two assets both of 100_000 amount. An error occurred here:

out, err := test_pool.CalcOutAmtGivenIn(ctx, tc.tokenIn, tc.tokenOut, swapFee)

Amount of tokenIn here is 1000. However, an error which I mentioned at first occurred in cfmm solver. When debugging, these are variables from the solver:

a(result of solver) 68232581257346302.337765795431794666538236795097975586
xReserve(tokenIn amount) 10000000.000000000000000000000000000000000000

I made sure that all the parameters passed correctly into the cfmm solver function. My guess, there is something wrong with the function itself.

@AlpinYukseloglu
Copy link
Contributor

AlpinYukseloglu commented Sep 22, 2022

This issue (and several others) is fixed by our new solvers in #2697 and #2816! Those changes still need to be merged in and wired up to our pool functions (e.g. CalcOutAmtGivenIn), but after we do that the issue you mentioned should be solved

Unfortunately #2346 is currently blocked on those two PRs (and their multi-asset versions), so if you'd like to pick up something that isn't blocked, anything that's tagged "Good First Issue" should be available to be worked on directly

@osmosis-labs osmosis-labs deleted a comment Sep 22, 2022
@pysel pysel closed this as completed Sep 23, 2022
Repository owner moved this from Needs Review 🔍 to Done ✅ in Osmosis Chain Development Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants