Get a list of all token holders

How would I get a list of all token holders using Moralis and Javascript?

you mean ERC20 tokens?

if you have your own smart contract, you could sync all the transfer events in your server for that smart contract

Shouldn’t there be a simpler way? If I track transfers, I would have to also track balances just to get the number of wallets currently holding. I would have to store all wallet addresses. When a transfer occurred, I would have to check the balance of the sender and the receiver. If the sender’s balance == 0, I would have to remove them from my stored list of wallets. When I look on BSC scan, it shows the number of wallets holding. They certainly aren’t calculating balances on the fly.

There may be simpler ways, from what I know there isn’t an API endpoint in Moralis that could give you that information directly.

You could propose it on

it will require to make all those processing that you say for all the possible tokens.

you can also look at covalent plugin: