osmosis-labs / fee-abstraction

Enable users on any Cosmos chain with IBC connections to pay fee using IBC tokens.
36 stars 17 forks source link

Add support for getting price with multihop route #183

Open tuantran1702 opened 7 months ago

tuantran1702 commented 7 months ago

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 commented 7 months ago

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

faddat commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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