

How to Get the Top Wallets on Ethereum with The Graph
Why Track Top Wallets?
High-value wallets move markets. Spotting them early lets you:
- Protect users – flag risky inflows before they hit your dapp
- Focus growth – airdrop or message holders who matter most
- Measure decentralization – know how supply is distributed
Until now you either ran an archive node or stitched third-party APIs. The Graph makes it easy with two options:
Option 1 – Token API in Three Steps
One REST endpoint returns the richest wallets for any ERC-20.
curl --request GET \--url "https://token-api.thegraph.com/holders/evm/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48?network_id=mainnet&orderBy=balance&orderDirection=desc&limit=100&page=1" \--header "Authorization: Bearer <JWT Key>"
- Filter human wallets – remove known exchange or contract addresses in code.
Result fields include address, balance, and percentageOfSupply
. cover pagination, historical snapshots, and ETH balances.
When to choose Token API
- You need data now, without on-chain indexing.
- Your stack is REST-centric (Python, Go, AI tools).
- You want pay-as-you-go cost control.
Option 2 – Build a Subgraph in Five Steps
Custom GraphQL for when you need full control.
Step 1: Create our Subgraph in Subgraph Studio
Subgraph Studio where we will interact with our Subgraph and get its endpoints after it has been deployed and is indexing our smart contract’s data.
- Open and click Create a Subgraph.
- Name it. For this example, we will call this subgraph nft‑transfers.
- Select the chain where your smart contract is deployed from the network list.
- Click Save.
Step 2: Scaffold Locally with the Graph CLI
Now, let’s spin up our Subgraph locally to prepare it to deploy to Subgraph Studio.
Install the CLI:
yarn install -g @graphprotocol/graph-cli
# npm, yarn, pnpm, and bun can also be used.
Inside an empty project folder, run:
graph init nft-transfers
Then follow the prompts:
- Choose the chain where your smart contract is deployed.
- Select Smart Contract.
- Paste your contract address when asked.
The CLI autogenerates three core files:
subgraph.yaml
— Manifest of data sources & handlers.schema.graphql
— Entity definitions (already includes a Transfer entity for ERC‑721).mapping.ts
— AssemblyScript logic.
Heads‑up: The CLI automatically scaffolds all entities and their handlers for you. In fact, every event emitted by the contract you supply to graph init is mirrored in the generated schema and mapping stubs, so for most vanilla use‑cases you can deploy without hand‑editing these files.
Step 3: Build & Deploy
Now that our Subgraph is scaffolded locally, we can deploy it to Subgraph Studio and begin indexing!
Back in your project folder:
yarn codegen && yarn build
# Authenticate once per machine
graph auth --studio <DEPLOY_KEY>
# Deploy
graph deploy --studio nft-transfers
After the initial sync finishes, Studio will display a GraphQL Playground. Copy the endpoint ending in /graphql
and test it with the pre-populated query.
When to choose a subgraph
- You plan to expose a public API for your community.
- You want customizability with how your indexed data is stored and provided.
Putting It All Together
Want to try out Token API or Subgraphs? Get your and read to get building fast with Token API, or hop into to build your custom Subgraph.
And as always, is there should you have any questions.
Happy building!
About The Graph
is the leading indexing and query protocol powering the decentralized internet. Since launching in 2018, it has empowered tens of thousands of developers to effortlessly build and leverage across countless blockchains, including Ethereum, Solana, Arbitrum, Optimism, Base, Polygon, Celo, Soneium, and Avalanche. With powerful tools like Substreams and Token API, The Graph delivers high-performance, real-time access to onchain data. From low-latency indexing to rapid token data, it serves as the premier solution for building composable, data drive dapps.
Discover more about how The Graph is shaping the future of decentralized physical infrastructure networks (DePIN) and stay connected with the community. Follow The Graph on , , , , , and . Join the community on The Graph’s , join technical discussions on The Graph’s .
oversees The Graph Network. , , , , and are seven of the many organizations within The Graph ecosystem.