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

fix: CalcOutAmtGivenIn query #208

Merged
merged 2 commits into from
Nov 11, 2024
Merged

fix: CalcOutAmtGivenIn query #208

merged 2 commits into from
Nov 11, 2024

Conversation

crnbarr93
Copy link
Collaborator

@crnbarr93 crnbarr93 commented Oct 31, 2024

What is the purpose of the change

This change adds another query for CalcOutAmtGivenIn which matches the specification for the CosmWasm pool module.

@crnbarr93
Copy link
Collaborator Author

crnbarr93 commented Nov 2, 2024

osmosisd q gamm estimate-swap-exact-amount-in 1933 osmo1twq36c866tdjhp4jgsayr0un5rn7adv4xwm0e7qs78te65pmynqqzwulk4 100uosmo --swap-route-denoms=ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4 --swap-route-pool-ids=1933 --node https://rpc.osmosis.zone
Error: rpc error: code = Unknown desc = rpc error: code = Internal desc = Error parsing into type sumtree_orderbook::msg::QueryMsg: unknown variant `calc_out_amt_given_in`, expected one of `spot_price`, `calc_out_amount_given_in`, `get_total_pool_liquidity`, `calc_in_amt_given_out`, `get_swap_fee`, `all_ticks`, `get_maker_fee`, `auth`, `is_active`, `orders_by_owner`, `orders_by_tick`, `orderbook_state`, `denoms`, `ticks_by_id`, `get_unrealized_cancels`: query wasm contract failed: unknown request

This is the current error returned on mainnet.

osmosisd q gamm estimate-swap-exact-amount-in 1933 osmo1twq36c866tdjhp4jgsayr0un5rn7adv4xwm0e7qs78te65pmynqqzwulk4 100uosmo --swap-route-denoms=ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4 --swap-route-pool-ids=1933
token_out_amount: "39"

This is the response on a local edgenet with the upgraded contract.

@crnbarr93 crnbarr93 marked this pull request as ready for review November 2, 2024 13:06
@crnbarr93 crnbarr93 merged commit bfd1c75 into main Nov 11, 2024
2 checks passed
@crnbarr93 crnbarr93 deleted the connor/out-given-in-query branch November 11, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants