-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hi,
I can see that some prices for a given asset can be "wrong" somehow.
I've encountered this problem myself and would like to share it with you.
When you try to query for a price, the accuracy of the result price depends greatly from the available liquidity.
Typical example is with BTC, if you want to estimate the price and you query a path payment (or other method) for 1 BTC you may have a result far below what you could get for your actual balance if you have 0.001 BTC for example.
I've ended up with the following method:
if
balance > 1
then
query the price with base 1
else
query the balance amount
There are still some caveats with this method, hopefully you will find a better solution.
So, what I found the most reliable was to use tradeAggregation average.
Best regards,
Vincent