You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: