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

[x/gamm]: Add RPC query endpoints for joining and exiting pools #2956

Closed
georgemc98 opened this issue Oct 6, 2022 · 2 comments · Fixed by #2972 or #3242
Closed

[x/gamm]: Add RPC query endpoints for joining and exiting pools #2956

georgemc98 opened this issue Oct 6, 2022 · 2 comments · Fixed by #2972 or #3242
Assignees
Labels

Comments

@georgemc98
Copy link
Contributor

Background

It would be helpful to have a RPC query that returns the lp shares when providing liquidity to a pool. It would also be helpful to have a query that returns the assets returned withdrawing liquidity from a liquidity pool. These queries will be useful when using a StargateQuery in cosmwasm smart contracts.

Suggested Design

Here is the commit for the PoolType query that was added recently: e55e13d. The design should follow the steps taken in this commit to add RPC end points for the four following queries:

  • QueryJoinPool
    • Parameters: QueryJoinPoolSharesRequest{ PoolId, TokenInMaxs}
    • Returns: QueryJoinPoolSharesResponse { ShareOutAmount, TokenIn }
  • QueryJoinSwapExactAmountIn
    • Parameters: QueryJoinSwapExactAmountInRequest{ PoolId, TokenIn}
    • Returns: QueryJoinSwapExactAmountInResponse { ShareOutAmount }
  • QueryExitPool
    • Parameters: QueryExitPoolSharesRequest{ PoolId, ShareInAmount }
    • Returns: QueryExitPoolSharesResponse { TokenOut }
  • QueryExitSwapShareAmountIn
    • Parameters: QueryExitSwapShareAmountInRequest{ PoolId, TokenOutDenom, ShareInAmount }
    • Returns: QueryExitSwapShareAmountInResponse { TokenOutAmount }
@pysel
Copy link
Member

pysel commented Oct 6, 2022

I would like to work on this issue!

@georgemc98
Copy link
Contributor Author

georgemc98 commented Oct 6, 2022

I would like to work on this issue!

Excellent. I am going to start on QueryJoinPool and QueryExitPool today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
3 participants