Cambrian Holder Token Balances (USD) API

By Cambrian Network solana

GET /api/v1/solana/holder-token-balances

Holder Token Balances (USD)

This endpoint returns token balances in USD for a specific user wallet, sorted by balance descending. It provides comprehensive information about all tokens held in a wallet along with their current USD values.

Business Value

  • Portfolio Management: Track the complete token portfolio value across different assets for investment analysis
  • Risk Assessment: Monitor token concentration and diversification for risk management purposes
  • Financial Reporting: Generate accurate USD valuations for accounting and tax reporting requirements
  • Trading Decisions: Make informed trading decisions based on current holdings and their market values
  • Wealth Tracking: Monitor overall portfolio performance and changes in token values over time

Endpoint Details

URL:

https://opabinia.cambrian.network/api/v1/solana/holder-token-balances

Method: GET
Authentication: Required via X-API-Key header

Query Parameters

Parameter Type Required Default Description
wallet_address string Yes - Wallet address
limit integer No 10 Limit the number of results (max: 1000)
offset integer No 0 Offset the results, allows you to skip a number of rows before starting to return rows (max: 100000)

Response Field Descriptions

Response Field Type Description
tokenAddress FixedString(44) The token mint address on Solana
balanceRaw UInt64 The raw token balance in smallest units
balanceUSD Float64 The USD value of the token balance

Examples

1. Get Wallet Token Balances

This example demonstrates retrieving token balances for a wallet address with their USD values.

curl -X GET "https://opabinia.cambrian.network/api/v1/solana/holder-token-balances?wallet_address=7VHUFJHWu2CuExkJcJrzhQPJ2oygupTWkL2A2For4BmE" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

{
  "columns": [
    {
      "name": "tokenAddress",
      "type": "FixedString(44)"
    },
    {
      "name": "balanceRaw",
      "type": "UInt64"
    },
    {
      "name": "balanceUSD",
      "type": "Float64"
    }
  ],
  "data": [
    [
      "8g6gvq5r9VEBN5bSBsNMWZepAEFhHYSZCqBP8SysF2mw",
      990000000000000,
      990397108.4939067
    ],
    [
      "CA4ppFfrVWPsBPY1BezLhY7vnY1qtjhfNPoqb56fLGtw",
      510000000000000,
      413886588.9342
    ],
    [
      "AQCq97gywgAvsUVMr1SMYCq1pu541evPEPUcXfG8tWsn",
      50000000000000000,
      208488703.50445488
    ],
    [
      "GtfLRA4B3D6bD3VaoH7AsNY5CNkWSfd3EAmK4E26okoh",
      80000000000000,
      150730665.0256998
    ],
    [
      "CXkcNZBF1urkFVrdp62EVosMQsdewGQFmZZQkC9aPjtS",
      50000000000000,
      50271465.935735546
    ]
  ],
  "rows": 5
  // ... additional rows omitted for brevity
}

The response shows the wallet's top 5 token holdings by USD value, with the largest holding being worth approximately $990 million USD.

2. Get Limited Token Holdings

This example demonstrates retrieving only the top 3 token holdings for the wallet.

curl -X GET "https://opabinia.cambrian.network/api/v1/solana/holder-token-balances?wallet_address=7VHUFJHWu2CuExkJcJrzhQPJ2oygupTWkL2A2For4BmE&limit=3" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

{
  "columns": [
    {
      "name": "tokenAddress",
      "type": "FixedString(44)"
    },
    {
      "name": "balanceRaw",
      "type": "UInt64"
    },
    {
      "name": "balanceUSD",
      "type": "Float64"
    }
  ],
  "data": [
    [
      "8g6gvq5r9VEBN5bSBsNMWZepAEFhHYSZCqBP8SysF2mw",
      990000000000000,
      990397108.4939067
    ],
    [
      "CA4ppFfrVWPsBPY1BezLhY7vnY1qtjhfNPoqb56fLGtw",
      510000000000000,
      413886588.9342
    ],
    [
      "AQCq97gywgAvsUVMr1SMYCq1pu541evPEPUcXfG8tWsn",
      50000000000000000,
      208488703.50445488
    ]
  ],
  "rows": 3
}

The response returns only the top 3 token holdings, showing a total value of over $1.6 billion USD across these top assets.

x402 Payment Option

This endpoint supports pay-per-use access via the x402 payment protocol (v2) — pay $0.05 USDC per request using blockchain micropayments. No API key required.

Quick Start (TypeScript)

npm install @x402/fetch @x402/evm viem
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));

const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const response = await fetchWithPayment(
  "https://deep42.cambrian.network/api/v1/solana/holder-token-balances"
);
const data = await response.json();

Quick Start (Python)

pip install "x402[httpx]"
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

async def main():
    client = x402Client()
    account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
    register_exact_evm_client(client, EthAccountSigner(account))

    async with x402HttpxClient(client) as http:
        response = await http.get("https://deep42.cambrian.network/api/v1/solana/holder-token-balances")
        print(response.json())

asyncio.run(main())

Payment Flow

  1. Send a normal request to the endpoint (no API key needed)
  2. Server returns 402 Payment Required with payment details
  3. The x402 SDK automatically signs a payment authorization with your wallet
  4. The SDK resubmits the request with the signed payment
  5. Server verifies payment and returns the API response

The x402 SDK handles steps 2–5 automatically.

Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request


Related Endpoints

  • /api/v1/solana/ohlcv/token - Retrieve Open, High, Low, Close, and Volume data for any SPL token
  • /api/v1/solana/orca/pools/fee-metrics - Retrieves core metrics like fees, volume, TVL in USD, and Fee APR for Orca Whirlpools
  • /api/v1/solana/pool-transactions - Retrieve paginated list of trades/transactions for a specified Solana pool address
  • /api/v1/solana/ohlcv/pool - Retrieve OHLCV data for individual pool contracts enabling pair-specific price analysis
  • /api/v1/solana/pool-transactions-time-bounded - Get detailed transaction data for SPL tokens across major Solana DEXs with timestamp filtering