1

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?

1 Answer 1

0

There is one catch: the blockchain has no idea what your wallet is, it only sees different address. There is not a guaranteed way to achieve this.

You might want to group these by their stake key, so after listing all the addresses you need to sum these sharing the same stake key.

That being said, just because the address contains a specific stake key, it does not mean that it is the same wallet. This is what we call mengled addresses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.