Skip to content

About

Every wallet holding a Solana SPL or Token-2022 token, as a CSV: balances per wallet, pools marked.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Solana Token Holder Snapshot (CLI)

Write every wallet holding an SPL or Token-2022 token to a CSV, with balances summed per wallet and pools marked. One small Node.js script, no build step.

Prefer a web app? Solstack Holder Snapshot needs no RPC key, reads tokens with millions of holders and NFT collections, and links wallets funded from the same source. Guide: How to take a Solana holder snapshot.

What it does

  • Reads every token account of a mint in one getProgramAccounts call, fetching only the 40 bytes it needs from each (owner and amount).
  • Counts wallets, not token accounts. A wallet that holds the same token in several accounts appears once, with the balances added up.
  • Marks program-owned holders. A holder address off the ed25519 curve has no private key: it's a liquidity pool, vault, bonding curve or locker, not a person. These are flagged program_owned so you can leave them out of an airdrop.
  • Works with SPL Token and Token-2022 mints.
  • Prints the top 10 and the share of supply each holds.

Use the CSV for airdrops, holder rewards, or checking how concentrated a token is. To airdrop with the Solana multisender, turn it into wallet,amount lines with what each wallet should get.

Quick start

Needs Node.js 18.11 or newer and an RPC endpoint that serves getProgramAccounts for the token programs. The public api.mainnet-beta.solana.com endpoint doesn't (and public devnet doesn't for Token-2022), so use one from your RPC provider.

git clone https://github.com/solstackxyz/solana-holder-snapshot.git
cd solana-holder-snapshot
npm install

node snapshot.mjs <MINT ADDRESS> --rpc https://your-rpc-url

Options

Option What it does
--rpc <url> RPC endpoint that serves getProgramAccounts
--cluster <name> mainnet-beta (default), devnet or testnet, used when --rpc isn't given
--out <path> CSV file to write (default holders-<mint>.csv)
--include-zero Also list wallets whose token accounts are empty

Example

A real devnet run on a Token-2022 mint with a 1% transfer fee:

$ node snapshot.mjs FSPRtLxT5aMxvmkA5vw4LJhsm1KaWStEkECzJF7pHYLQ --rpc <devnet RPC>

Reading every token account of FSPRtLxT5aMxvmkA5vw4LJhsm1KaWStEkECzJF7pHYLQ (Token-2022)...

Token accounts   6
Holders          6 wallets with a balance
Supply           1000 (99.0050% held by the wallets listed)

Top 10
   1  Aphz4iwnfdFQ8a333TdkqNgpQBL379bxzmyLXS6JJmPr   50.0000%
   2  EVPkFpFXPmrwv54MvBNVC8JVLbg4srybqwwuvAX2YkP7    9.8010%
   3  G6CsNBwRMdDdgY9YFSsrMm2Ft7W6qNbWyfUFCTbVSuQx    9.8010%
   4  5Nc55uzVwjwuDbhNLXiJJXqPddXtLJESpr5JDUjMSNXu    9.8010%
   5  9Cgq4ufUF5DpRUjG9yFHvVZRqkmnxsfxTm18JtJtViit    9.8010%
   6  DdnAF1B9FLxYHXxTgYXe6UH9Xhzky2vEPhnZVrLEBfXX    9.8010%

Wrote 6 rows to holders-FSPRtLxT5aMxvmkA5vw4LJhsm1KaWStEkECzJF7pHYLQ.csv

The CSV:

rank,wallet,amount,percent_of_supply,token_accounts,program_owned
1,Aphz4iwnfdFQ8a333TdkqNgpQBL379bxzmyLXS6JJmPr,500,50.0000,1,false
2,EVPkFpFXPmrwv54MvBNVC8JVLbg4srybqwwuvAX2YkP7,98.01,9.8010,1,false

Limits

  • Large tokens. A single getProgramAccounts call over hundreds of thousands of accounts can time out or hit your provider's response limit. The web Holder Snapshot splits the read into address ranges and handles tokens with millions of holders.
  • NFT collections are many mints, one per NFT, so this script (one mint) doesn't cover them. The web version does.
  • Program-owned is a strong hint, not a label: it tells you a holder is a program address, not which program.

More Solana tools

This script comes from Solstack, a set of web tools for Solana tokens: Airdrop to every holder, Smart Money Tracker, Token Inspector and more.

Other scripts: solana-multisender · solana-rent-reclaim

License

MIT

About

Every wallet holding a Solana SPL or Token-2022 token, as a CSV: balances per wallet, pools marked.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages