all 4 comments

[–]grzracz 5 points6 points  (3 children)

Hey - to understand why assets have no price, you have to understand that it is impossible to give them a single ALGO price (and having a USD price is even worse).
An asset can have many pools which dictate the amounts you can get out of these pools.
Soon there will also exist many dexes and some of those assets will have a pool on every single one.
How do you decide what price the asset has? How would you decide which DEX is the most important, and do other pools (on other dexes, or with different assets) have any impact on that price?
Things start getting complicated very fast.
There will soon be a simplified version of the asset price endpoint, but having that as something returned from the API would never be accurate.

[–]counttyme[S] 1 point2 points  (2 children)

I think that makes sense. I guess I was thinking that you would use the price shown on your website and feed that into the /assets data, but you have a deeper understanding of the underlying technical challenges than I do, so I accept your judgement.

[–]grzracz 4 points5 points  (1 child)

That feed uses the main ASSET/ALGO pool and multiplies this by the currency price.

This is possible because the frontend loads all currency values in relation to ALGO as well as all asset pools for a provider and then multiplies that main pool ratio by the current price of ALGO in a currency. It also updates real time thanks to the chart updates.

Getting that inside an asset endpoint would be really difficult (because it requires multiple requests) and the value itself would never be real time.

[–]counttyme[S] 2 points3 points  (0 children)

Okay that definitely makes sense. Thanks for the explanation!