alephium / desktop-wallet

The official Alephium wallet for desktop
https://alephium.org
GNU Lesser General Public License v3.0
78 stars 44 forks source link

Use latest price as last data point in chart #778

Closed nop33 closed 1 year ago

nop33 commented 1 year ago

Closes #774

The problem was that the last item of the response of the getHistoricalPrice endpoint was slightly different than the latest price from the getPrice endpoint. The fix removes today's price received from the 1st endpoint and adds the one from the 2nd.

mvaivre commented 1 year ago

Thanks!

I'm noticing some artefacts in the graph, as if the interpolation between the last 2 points was broken.

image

It is caused by the fact that there can be 2 times the same date (day before today) overlayed in the chart.

nop33 commented 1 year ago

I'm noticing some artefacts in the graph, as if the interpolation between the last 2 points was broken. It is caused by the fact that there can be 2 times the same date (day before today) overlayed in the chart.

Hm, strange, I'll test with some other wallets, but in all my tests I ensured that each day is unique in the set of data...

nop33 commented 1 year ago

@mvaivre I've improved the algorithm that cleans the last chart data by ensuring there are no duplicates and that the "today"'s date is always skipped so that we can manually add the latest price.