Skip to main content
TLDR:
  • Helius’ getTokenAccounts can be replaced with standard Solana JSON-RPC calls like getProgramAccounts and getTokenAccountBalance.
  • getProgramAccounts with filters and pagination helps gather all token accounts for a mint, though be mindful of rate limits and data size.
  • For larger tokens (like USDC), consider chunking requests and storing results in a database for performance.
  • Overall, the standard RPC approach is fully portable and avoids provider lock-in.

Main article

For starters, this is not a poke at Helius. It’s something that builders ask for and we provide a simple tutorial.

Overview

This tutorial shows how to migrate from Helius’ custom getTokenAccounts method to standard Solana JSON-RPC methods when switching node providers. We’ll demonstrate how to achieve the same functionality using getProgramAccounts with proper pagination and data filtering.

Implementation

For illustration purposes, we’ll provide you with a Helius script, a standard methods script, and a sample script to print token holders using standard methods. We’ll be using the ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx token in all examples. So feel free to replace is with any other token. Although do note that tokens with higher holder count USDC will most likely need a more optimized approach. Also be sure to check Limits as getProgramAccounts is a heavy call and in general this sort of operation on Solana infrastructurally is definitely not even in the cruiserweight class.

Get your own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Helius

Here’s a simple Helius example: Remember to replace ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx with your token if want.

Standard JSON-RPC example

Here’s a standard one: Remember to replace ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx with your token if want.

Standard JSON-RPC example with DB connection

Here’s a sample of how you’d be using the standard getProgramAccounts method to monitor the holders of a token and then dumping the data to a PostgreSQL DB and keeping key-value store of accounts holding the token and the number of tokens up to date.

Ake

Ake Director of Developer Experience @ Chainstack
Talk to me all things Web3
20 years in technology | 8+ years in Web3 full time years experience
Last modified on June 22, 2026