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

Add support for getting price with multihop route #183

Open
tuantran1702 opened this issue Apr 10, 2024 · 5 comments
Open

Add support for getting price with multihop route #183

tuantran1702 opened this issue Apr 10, 2024 · 5 comments

Comments

@tuantran1702
Copy link
Collaborator

tuantran1702 commented Apr 10, 2024

Current Limitation

Price data is only available for token pairs with existing liquidity pools on Osmosis. The Multihop route is calculated off-chain.
https://github.com/osmosis-labs/osmosis/blob/e4290c54c0f77b91b6a08bdad1ec62f9739dc963/x/poolmanager/README.md#multi-hop

Desired Functionality

Enable price fetching for any supported token against the native token, regardless of whether a liquidity pool exists. This capability is needed to accurately calculate fees for a wider range of token pairs.

@tuantran1702
Copy link
Collaborator Author

probably can utilize Sidecar Query Server to fetch price on multihop based swap:
ion -> osmo-> localStarOnOsmo(ibc/transfer/channel-6061/ustars)
Example result
Sidecar Query Server Integration Guide

@tuantran1702 tuantran1702 changed the title Add support for getting TWAP with pool route Add support for getting price with multihop route Apr 10, 2024
@faddat
Copy link
Member

faddat commented Jul 8, 2024

I think that the sidecar is mainly for serving our PC requests concerning the price. Joe I think we may need to invent something better, but I'm not claiming to know what that is just yet.

Do you have any thoughts?

@faddat
Copy link
Member

faddat commented Jul 8, 2024

You know actually if they use Slinky, and I think that they may, this might be a good path forward. I will ask their team

@faddat
Copy link
Member

faddat commented Jul 11, 2024

But they do not use Slinky, and probably that is not a good solution for this. I think that the best solution might actually be to just pull prices from osmosis using ICA but then route transactions using pfm.

@tuantran1702
Copy link
Collaborator Author

But they do not use Slinky, and probably that is not a good solution for this. I think that the best solution might actually be to just pull prices from osmosis using ICA but then route transactions using pfm.

The problem is that the multihop route is calculated off-chain sir @faddat.
https://github.com/osmosis-labs/osmosis/blob/e4290c54c0f77b91b6a08bdad1ec62f9739dc963/x/poolmanager/README.md#multi-hop

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

No branches or pull requests

2 participants