I'm using the Blockfrost API to get a list of the top holders of an asset. ie. The people with the highest quantity of this asset in their wallet.
I'm using Blockfrost's API, and the specific call I'm using is : https://cardano-mainnet.blockfrost.io/api/v0/assets/{asset}/addresses
This returns a list of addresses and the quantity held by each address:
[
{
"address": "addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz",
"quantity": "1"
},
{
"address": "addr1qyhr4exrgavdcn3qhfcc9f939fzsch2re5ry9cwvcdyh4x4re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qdpvhza",
"quantity": "100000"
},
{
"address": "addr1q8zup8m9ue3p98kxlxl9q8rnyan8hw3ul282tsl9s326dfj088lvedv4zckcj24arcpasr0gua4c5gq4zw2rpcpjk2lq8cmd9l",
"quantity": "18605647"
}
]
So... I thought - just sort the list descending and display the top 10, right?
Well that works and it gives me the list of the top 10, but here's the catch...
If anybody uses a different receiving address to purchase the same asset from the same wallet, each receiving address is listed and returned separately by the API. In other words, if anyone buys the same asset (any amount) from the same wallet multiple times, using different receiving addresses, the purchases are not added together and represented as the total holdings for that wallet.
So my top 10 are not really the top 10...! (Just the top 10 biggest purchases...)
Is there any way to get the top 10 holders of a particular asset using the Blockfrost API or any other method?