Skip to content

About query pool swap rate #1

@marco-sundsk

Description

@marco-sundsk

It looks like a query interface (view function) of contract that can return multiple pool states is neccessary for your solution.

And although there is a get_return view function in contract to estimate swap out amount according to swap in amount, I guess it is not what you need, cause you can not know the exactly amount of input in advance.

So I am considering to add a view function that can receive multiple pool id as a vector and return each liquidity amounts of each pool. Besides that, pool fee is more static and can be retrieved in advance from ref-finance backend data service.

Then, amountA, amountB and fee of each pool are all in your hand, the solution would go smoothly, wouldn't it? Is there anything else needed for this solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions