SignificantTrades
SignificantTrades copied to clipboard
Minor question
Hi,
As we can see, there's a transaction with 1000k value. I thought these would show up as 1 million and with cash animation? Correct me if I misunderstood.
Thanks
You are right, definitely an issue here Most likely a rounding error, but since I dont do any round myself, maybe its a limitation of javascript related to the number of decimal allowed
https://pastebin.com/LrPiyiV0 < theses are the trades that was in this aggregation respectively exchange | timestamp | price | size | side
So if you take thoses trades, sum the size and prices
var trades = rawPastbinOutput.split('\n').map(a => a.split(' '));
var size = trades.reduce((sum, trade) => sum + (+trade[3]), 0)
var price = trades.reduce((sum, trade) => sum + (trade[2] * trade[3]), 0) / size
You get (size * price) = 132.8170523018985 * 7529.153694263291 = 999999.9999999999
Imma investigate this but one solution could be to round the very last decimal
Math.ceil(999999.9999999999 * 1000000000) / 1000000000 = 100000