-
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] Re-implement ExitSwapExternAmountOut generically #1130
Comments
@ValarDragon is this still planned for v8? If yes, could you write up the description for me please, and I can get started on this tomorrow |
Just adding some notes for myself: There is an explanation in code about what needs to be done: osmosis/x/gamm/keeper/pool_service.go Lines 337 to 353 in a68928e
This PR adds helper functions to implement ExitSwapExternOutGenerically |
So what way ExitSwapExternAmountOut wants to do is:
I suspect this will be off for non-50/50 pools, and will have rounding errors (cref #1196). I'm not sure if it maybe makes sense to not implement this generically, and just make a second interface AMMs have to implement for this feature, thats then runtime type-check'd. So I'd suggest we just make a second interface thats optional, of the form
And then we implement that method on balancer, but not on other pools |
Do you want to take a stab at defining the interface, and then changing the logic in amm.go to work around that interface? And we can just add the balancer implementation of the interface afterwards / in a second PR? (It should mostly be looking at the v7 code, and integrating that into amm.go) |
I will work on that, thanks for the detailed explanation |
I like the 2nd interface idea. |
Just an update, I'm working on this but I might do both in a single PR. I found that it is easier for me to understand the context while referencing the old implementation. Hope that's okay |
No description provided.
The text was updated successfully, but these errors were encountered: