blockchain-http icon indicating copy to clipboard operation
blockchain-http copied to clipboard

Rounded max and min amounts from /oracle/prices/stats endpoint

Open pantyporowicz opened this issue 4 years ago • 11 comments

Hi, I noticed problem with max and min properties from /oracle/prices/stats endpoint. Why are they rounded? I think, these amounts should be returned as decimals. image

pantyporowicz avatar Sep 17 '21 10:09 pantyporowicz

These are reported as HNT and not as bones since their value would be too large for json/javascript to be able to parse

madninja avatar Sep 17 '21 11:09 madninja

@madninja, can you please, elaborate more on your answer?

szygendab avatar Sep 17 '21 12:09 szygendab

I think @pantyporowicz meant to ask for making the format of decimal for min and max more precise i.e. to be equal to decimal places in avg field.

szygendab avatar Sep 17 '21 12:09 szygendab

The format is precise though. The 20.0 is exactly 20.0 HNT and is not rounded

madninja avatar Sep 17 '21 13:09 madninja

@madninja, so how come median, and avg are resulting in such values as above?

They should also be 20.0 and 20.0

szygendab avatar Sep 17 '21 13:09 szygendab

@madninja, so how come median, and avg are resulting in such values as above?

They should also be 20.0 and 20.0

Because the average is rounded to as many decimals precision as you see there..

madninja avatar Sep 17 '21 14:09 madninja

@madninja , but if max and min are equal to 20, an example from above should actually be:

min - 20.0 max - 20.0 avg - 20.0 median - 20.0

...

Please, explain why there is no consistency between this data... It's not about the value rounding as you've mentioned it here...

szygendab avatar Sep 17 '21 14:09 szygendab

yeah, we'd need to look at all the actual values to see what happened there.. This is just using the Postgres avg function over time series data

madninja avatar Sep 17 '21 14:09 madninja

@madninja, do you have any updates on this issue?

szygendab avatar Sep 27 '21 08:09 szygendab

Nope.. do you have any additional data by looking at the database?

madninja avatar Sep 27 '21 13:09 madninja

@madninja, we are external users and we use only helium API. We do not have access to your database. Any HTTP request ( such as this one ) returns rounded values for min and max as in the first example written by @pantyporowicz.

szygendab avatar Sep 29 '21 11:09 szygendab