Solana - Error "Too many accounts requested, limit is 10,000,000"
When using Tatum's API to retrieve the token balance of a Solana address, you may encounter the following error:
{
"statusCode": 403,
"errorCode": "erc20.get.error",
"message": "Get operation failed",
"cause": "failed to get accounts owned by program ####: Too many accounts requested, limit is 10,000,000",
"dashboardLog": "https://dashboard.tatum.io/logs?id=####"
}
Cause of the Error
This error occurs because the endpoint has a default limitation on the number of accounts that can be requested in a single operation.
The error arises when the number of accounts owned by a token program exceeds the threshold of 10 million accounts.
Current Status
At present, there are no workarounds for this limitation via Tatum core-api.
However, there's a workaround via the Solana RPC call method "getTokenAccountsByOwner
". Find the method documentation HERE.
Request example:
curl --location 'https://solana-mainnet.gateway.tatum.io' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwner",
"params": [
"HMKa355WmAEPDMakaWrS47goUiggsonDiLH8kicck6pL",
{
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
},
{ "encoding": "jsonParsed" }
]
}
Note
Find the Official Solana documentation for getTokenAccountsByOwner RPC Method HERE.
Updated 1 day ago