Skip to main content

Parameters

string
required
Public key of the token mint (base-58 encoded)
object
Configuration object containing:
number
Maximum number of accounts to return (default: 20)
string
Commitment level (processed, confirmed, finalized)

Response

object
Object containing:
object
number
The slot the request was processed at
array
Array of token account objects containing:
string
Public key of the token account (base-58 encoded)
string
Raw amount of tokens as a string
number
Number of decimals configured for token’s mint
number
Token amount as a float, accounting for decimals
string
Token amount as a string, accounting for decimals

Code Examples

Basic Request

Using web3.js

Notes

  1. Returns the largest token accounts for a given mint
  2. Accounts are sorted by balance in descending order
  3. The response is immediate as it reads from the current state
  4. The accounts can change with token transfers and other operations
  5. The mint must be a valid token mint

Best Practices

  1. Use appropriate commitment level based on your needs
  2. Cache results when appropriate to reduce RPC load
  3. Monitor for changes in largest accounts
  4. Consider using websocket subscription for real-time updates
  5. Handle network errors and retry when appropriate

Common Errors

Use Cases

  1. Token Distribution Analysis
  2. Token Holder Monitoring
  3. Token Supply Planning