Tokens

Getting Started

Read Token Data

Fetch fungible token information directly from the Solana blockchain or through the DAS API for optimized queries.

What You'll Learn

This guide covers two approaches to reading token data:

  • Direct blockchain queries - Fetch token data using RPC calls
  • DAS API queries - Use indexed data for faster, more flexible searches

Fetching Token Data Directly

Get Token Metadata by Mint Address

To fetch a token's metadata directly from the blockchain, you need the mint address. This approach reads data directly from on-chain accounts.

Get Token Balance for a Wallet

Fetch the token balance a specific wallet holds for a given token mint.

Get All Token Accounts for a Wallet

Retrieve all token accounts owned by a specific wallet to see all their token holdings.

Fetching Token Data with DAS API

The Digital Asset Standard (DAS) API provides indexed access to token data, enabling faster queries and advanced filtering capabilities. This is the recommended approach for applications that need to query multiple tokens or search by various criteria.

Get Token by Mint Address

Get All Fungible Tokens by Owner

Retrieve all fungible tokens owned by a wallet address. Use the FungibleToken interface filter for efficient querying.

Search Tokens by Creator

Find all fungible tokens created by a specific address.

Comparing Approaches

FeatureDirect RPCDAS API
SpeedSlower for bulk queriesOptimized for bulk queries
Data freshnessReal-timeNear real-time (indexed)
Search capabilitiesLimitedAdvanced filtering
Rate limitsStandard RPC limitsProvider-dependent
Use caseSingle token lookupsPortfolio views, searches

Tips and Best Practices

  1. Use DAS for portfolio views - When displaying all tokens a user owns, DAS API is significantly faster than multiple RPC calls.

  2. Enable showFungible - Always set showFungible: true in display options to get complete token information including balances and decimals.

  3. Handle decimals correctly - Token amounts are returned as raw integers. Divide by 10^decimals to get the human-readable amount.

  4. Cache metadata - Token metadata rarely changes. Cache it to reduce API calls and improve performance.

  5. Paginate large results - When fetching many tokens, use pagination to handle large result sets efficiently. See the DAS pagination guide for details.