BitboBTC / Feedback

1 stars 2 forks source link

BTC in ounces vs BTC in grams #36

Closed Fillippone closed 1 month ago

Fillippone commented 1 month ago

When looking at that graph, I find this confusing. BTC in OUNCES should be a replica of BTC in Grams, multiplied by the ration OUNCES/GRAMS (which is a fixed amount). Instead, the two graphs have different paths. Why is that? Maybe BTC in OZ is in USD, while BTC in grams is in EUR? Thanks!

JTuwiner commented 1 month ago

You're saying on this chart https://charts.bitbo.io/btc-gold/

Why do the lines not match each other exactly?

If so I believe it's because they are using different scale for the axis on the graph

Fillippone commented 1 month ago

Yes, the graph is that one. But the axis is not the problem: the ratio of the values is not constant as it should be.

2015-01-02 | 7.5 | 0.26 |   | 28.84615385 2015-05-24 | 5.68 | 0.2 |   | 28.400000 2018-01-02 | 317.89 | 11.21 |   | 28.35771632 2019-01-01 | 85.8 | 3.03 |   | 28.31683168 2020-01-01 | 134.53 | 4.75 |   | 28.32210526 2022-01-01 | 744 | 26.26 |   | 28.33206398 2023-01-03 | 255.2 | 9 |   | 28.35555556

Maybe it's only a rounding error due to the different scales.

JTuwiner commented 1 month ago

We get values in oz from API.

We multiply price with that day with exchange rate to get price in OZ.

And then we multiply OZ by 28.3495 to get grams.

And we round both numbers (results) to two decimals, so:

Two decimals: 7.5 / 0.26 = 28,846 Three decimals: 7.501 / 0.264 = 28,413 Four decimals: 7.5019 / 0.2646 = 28,352 Five decimals: 7.50199 / 0.26462 = 28,35 Six decimals: 7.501992 / 0.264625 = 28.3495 (this is the exact number we use to convert oz to gram)

So it is rounding thing with small values.