Skip to main content
Building a wallet tracker used to mean writing chain-specific RPC logic for every network, normalizing token decimals, fetching prices separately, and stitching it all together. In 2026, you can skip all of that. This tutorial shows how to build a fully functional multi-chain wallet tracker in under 10 minutes using the Mobula API — one endpoint, all chains, aggregated PnL included.

What You’ll Build

A CLI wallet tracker that:
  • Fetches all token holdings across every chain (EVM + Solana)
  • Shows current USD value and 24h PnL per token
  • Displays total portfolio value and overall PnL
Time to build: ~10 minutes Lines of code: ~50 API calls needed: 1

Prerequisites


Step 1: Install the SDK


Step 2: Fetch the Portfolio

That’s the entire data-fetching layer. One call returns balances, prices, and PnL across all chains.

Step 3: Display the Results


Step 4: Run It

Output:

What the API Returns

The /api/2/wallet/portfolio endpoint gives you:
  • total_wallet_balance — total USD value across all chains
  • total_realized_pnl — realized PnL since first tracked transaction
  • assets[] — array of token holdings, each with:
    • asset.symbol, asset.name, asset.logo
    • token_balance — raw token amount
    • estimated_balance — USD value
    • realized_pnl, unrealized_pnl
    • asset.blockchains — which chains the token exists on

Add Historical Balance

Want to show a balance chart over time? One more call:

Deploy as an API

Wrap it in a simple Express server:
You now have a production-ready multi-chain portfolio API.

Next Steps

  • Add DeFi positions/api/2/wallet/defi-positions for LP, lending, and staking
  • Track new wallets in real-time — subscribe via WebSocket for live balance updates
  • Label wallets/api/2/wallet/labels returns exchange labels, whale tags, and insider flags
Full API documentation → | SDK on npm →