1

I'm trying to create some sort of statistic generator related to ERC20s. Let's assume you have 10,000 Token A. I would like to tell users something like: "better than 0.5% of the accounts". Basically it would compare against the other holders of the specific token. I know this would be massive in terms of computer resources.

Is there a solution to that already ?

I can see on Etherscan that we can already see addresses by "holders" here

1

Is not so expensive in terms of computations (for a recent computer not older than 5 years).

As you are interested in a specific contract, you can get the addresses that have transferred tokens and then look for the individual balances. This should be difficult nor complicated.

To achieve this get the logs of the transfer events in the ERC20, like this you get a list of the addresses that hold tokens (or that had held tokens) then you loop on the balanceof function of the smart contract (which cost zero gas as in view)

Hope this helps

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.