Skip to main content

Wallet Portfolio

Fetch the complete token portfolio for any wallet address with automatic token discovery and USD pricing. No hardcoded token lists — discovers ALL tokens algorithmically.

GET /v1/onchain/wallet

curl "https://api.crypton.dev/v1/onchain/wallet?address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&chain=ethereum"

Query Parameters

address
string
required
Wallet address. Supports EVM (0x…), Solana (base58), and Bitcoin addresses.
chain
string
default:"ethereum"
Target chain. Supported: ethereum, base, arbitrum, polygon, bsc, optimism, avalanche, solana, bitcoin.

Example Response

{
  "status": "ok",
  "timestamp": 1709640000000,
  "data": {
    "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "chain": "ethereum",
    "total_value_usd": 142350.75,
    "tokens": [
      {
        "token": "ETH",
        "chain": "ethereum",
        "balance": 32.14,
        "price_usd": 2035.50,
        "value_usd": 65421.27
      },
      {
        "token": "USDC",
        "chain": "ethereum",
        "balance": 50000.0,
        "contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "price_usd": 1.0,
        "value_usd": 50000.0
      },
      {
        "token": "WETH",
        "chain": "ethereum",
        "balance": 10.5,
        "contract": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "price_usd": 2035.50,
        "value_usd": 21372.75
      }
    ]
  }
}

Response Fields

address
string
The queried wallet address.
chain
string
The chain that was queried.
total_value_usd
number
Sum of all token values in USD.
tokens
array
Tokens are sorted by value_usd descending (highest value first).

Token Discovery

Tokens are discovered algorithmically — no hardcoded token lists. The discovery method varies by chain:
ChainDiscovery MethodAPI Key Required
EthereumBlockscout tokenlistNo
BaseBlockscout tokenlistNo
ArbitrumBlockscout tokenlistNo
PolygonBlockscout tokenlistNo
OptimismBlockscout tokenlistNo
BSCAlchemy alchemy_getTokenBalancesALCHEMY_API_KEY
AvalancheAlchemy alchemy_getTokenBalancesALCHEMY_API_KEY
SolanagetTokenAccountsByOwner RPCNo
BitcoinBlockstream APINo
BSC and Avalanche require an ALCHEMY_API_KEY environment variable for token discovery. Without it, only native token balance is returned. All other chains work without any API key.

Pricing

Token prices come from two sources, fetched in parallel:
  • Native tokens (ETH, BNB, SOL, BTC, MATIC, AVAX): CoinGecko /simple/price API
  • ERC-20 / SPL tokens: DexScreener /tokens/v1/{chain}/{addresses} — batched 30 per request
Tokens without a DexScreener listing will show price_usd: 0.0.

Error Handling

On error, returns status: "error" with an empty portfolio rather than failing:
{
  "status": "error",
  "timestamp": 1709640000000,
  "data": {
    "address": "0xinvalid",
    "chain": "ethereum",
    "total_value_usd": 0.0,
    "tokens": []
  }
}

Live Testing

# Ethereum wallet (Vitalik)
curl -s "https://api.crypton.dev/v1/onchain/wallet?address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&chain=ethereum" | jq '{total: .data.total_value_usd, count: (.data.tokens | length), top5: [.data.tokens[:5][] | {token, balance, value_usd}]}'

# Base wallet
curl -s "https://api.crypton.dev/v1/onchain/wallet?address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&chain=base" | jq '{total: .data.total_value_usd, count: (.data.tokens | length)}'

# Solana wallet
curl -s "https://api.crypton.dev/v1/onchain/wallet?address=CjvEQ3SXXf1VsGdsUxKYScVEmuicFi3PjbJHZFCAw7jb&chain=solana" | jq '.data'

# Bitcoin wallet
curl -s "https://api.crypton.dev/v1/onchain/wallet?address=bc1qa5wkgaew2dkv56kc6hp23ly7dmnraucd5h2xm5&chain=bitcoin" | jq '.data'