How to build a multi-chain crypto portfolio tracker with the GoldRush API
Build a wallet dashboard in Next.js: find the chains a wallet uses, show its token balances, chart allocation and 30-day value, and flag risky approvals.
On this page
- What you'll build, and the read side of a wallet
- Which GoldRush endpoint answers which part
- Set up the project
- Step 1: Find the chains the wallet is active on
- Step 2: Fetch balances across chains and clean them
- Step 3: Get portfolio value over time
- Step 4: Serve the portfolio from one API route
- Step 5: Render the token list
- Step 6: Chart the allocation and the value over time
- Step 7: Check token approvals
- Step 8: Assemble the dashboard with a chain selector
- Step 9: Let users connect their wallet
- What a dashboard load costs
- Frequently asked questions
- Next steps
A crypto portfolio tracker answers three questions about a wallet: what it holds, what that is worth, and how the value has moved. Doing that across chains used to mean one balance request per chain for every chain you support. This guide builds a multi-chain tracker (a wallet dashboard) in Next.js with the GoldRush Foundational API and its TypeScript SDK, @covalenthq/client-sdk: it finds the chains a wallet is active on, lists its tokens with their value and 24h change, charts its allocation and its value over the last 30 days, and flags token approvals that put funds at risk. If you're choosing a crypto portfolio API for a product rather than following a tutorial, start there.
What you'll build, and the read side of a wallet
A wallet app has two halves. The write side signs and sends transactions: transfers, swaps, approvals. That needs the user's keys, and it lives in the user's wallet (MetaMask, Rainbow, Coinbase Wallet and so on). The read side fetches onchain data and displays it: token balances, their value, history, approvals. GoldRush is the read side. It never holds keys or sends transactions, so the tracker in this guide is read-only, and the one write it mentions (revoking an approval) happens in the user's wallet.
By the end you'll have:
- a chain selector built from the chains the wallet has actually used;
- a token list with logo, name, amount, value and 24h change;
- an allocation donut chart and a net worth total;
- a portfolio value over time chart for the last 30 days;
- an approvals check that flags unlimited allowances and high value at risk;
- a Connect wallet button, so the dashboard shows the visitor's own wallet.
Which GoldRush endpoint answers which part
Every panel is one endpoint. Costs are in credits, as the docs state them.
| Panel | Endpoint | SDK method | Cost |
|---|---|---|---|
| Chains the wallet uses | Address Activity API GET /v1/address/{walletAddress}/activity/ |
AllChainsService.getAddressActivity |
0.5 per call |
| Balances on up to 10 chains at once | Multichain Wallet Balance API GET /v1/allchains/address/{walletAddress}/balances/ |
AllChainsService.getMultiChainBalances |
2.5 per call (first page) |
| Balances on one chain | Token Balance API GET /v1/{chainName}/address/{walletAddress}/balances_v2/ |
BalanceService.getTokenBalancesForWalletAddress |
1 per call |
| Value over time | Historical Portfolio Value API GET /v1/{chainName}/address/{walletAddress}/portfolio_v2/ |
BalanceService.getHistoricalPortfolioForWalletAddress |
2 per 30 days |
| Approvals | Token Approvals API GET /v1/{chainName}/approvals/{walletAddress}/ |
SecurityService.getApprovals |
2 per call |
Set up the project
You need Node.js 20 or later, a little React, and a GoldRush API key: sign up and copy the key from the platform, or follow the quickstart. Create a Next.js app (App Router, TypeScript) and add the SDK and Recharts:
npx create-next-app@latest portfolio-tracker --ts --appcd portfolio-trackernpm install @covalenthq/client-sdk rechartsPut the key in .env.local. It has no NEXT_PUBLIC_ prefix, so Next.js keeps it on the server:
GOLDRUSH_API_KEY=your_goldrush_api_keyCreate one shared client. Every GoldRush call in this guide runs on the server (in lib/ and API routes), and the browser only ever talks to your own routes, so the key never reaches it.
import { GoldRushClient } from "@covalenthq/client-sdk"; // Server-side only: never import this file from a "use client" component, or the key ships to the browser.export const goldrush = new GoldRushClient(process.env.GOLDRUSH_API_KEY ?? "");Step 1: Find the chains the wallet is active on
Don't ask every chain for balances to learn where a wallet has been. The Address Activity API returns, in one call, the chains an address has activity on, each with its chain name (name, e.g. eth-mainnet), display label, logo_url and last_seen_at. That list drives everything else: the balances you fetch, the history you chart and the chain selector buttons. Mainnets only is the default; pass testnets: true to include testnets. The filter below drops any testnet anyway, so a selector never shows two "Ethereum" buttons.
lib/portfolio.ts starts with that call, then the balance helpers from step 2:
import { goldrush } from "./goldrush";import type { BalanceItem, Chain, ChainName, MultiChainBalanceItem } from "@covalenthq/client-sdk"; export type ActiveChain = { name: string; label: string; logo: string | null }; export type Holding = { chain: string; address: string; name: string; symbol: string; logo: string | null; amount: number; // whole tokens, decimals applied value: number; // in the quote currency (USD by default) change24h: number | null; // % change in value over 24h}; // Which chains has this wallet used? One call instead of one balance call per chain.export async function getActiveChains(address: string): Promise<ActiveChain[]> { const resp = await goldrush.AllChainsService.getAddressActivity(address); if (resp.error) throw new Error(resp.error_message ?? "address activity failed"); return (resp.data.items ?? []) .filter((c) => c.name && !c.is_testnet) .map((c) => ({ name: c.name!, label: c.label ?? c.name!, logo: c.logo_url }));} // Raw balances are integers in the token's smallest unit: divide by 10^contract_decimals.export function toUnits(raw: bigint | string | null, decimals: number | null): number { if (raw === null) return 0; return Number(raw) / 10 ** (decimals ?? 0);} // Keep what a person would want to see: no spam, no zero balances, largest value first.export function toHoldings(items: (BalanceItem | MultiChainBalanceItem)[], chain?: string): Holding[] { return items .filter((t) => !t.is_spam && t.balance !== null && BigInt(t.balance) > 0n) .map((t) => ({ chain: ("chain_name" in t && t.chain_name ? String(t.chain_name) : chain) ?? "", address: t.contract_address ?? "", name: t.contract_name ?? "Unknown token", symbol: t.contract_ticker_symbol ?? "", logo: t.logo_url, amount: toUnits(t.balance, t.contract_decimals), value: t.quote ?? 0, change24h: t.quote && t.quote_24h ? ((t.quote - t.quote_24h) / t.quote_24h) * 100 : null, })) .sort((a, b) => b.value - a.value);} // Balances on up to 10 chains in one call (Multichain Wallet Balance API).export async function getHoldings(address: string, chains: string[]): Promise<Holding[]> { const holdings: Holding[] = []; for (let i = 0; i < chains.length; i += 10) { const resp = await goldrush.AllChainsService.getMultiChainBalances(address, { chains: chains.slice(i, i + 10) as ChainName[], }); if (resp.error) throw new Error(resp.error_message ?? "multichain balances failed"); holdings.push(...toHoldings(resp.data.items ?? [])); } return holdings.sort((a, b) => b.value - a.value);} // Or one chain at a time (Token Balance API), e.g. when the user picks a chain.export async function getChainHoldings(address: string, chain: string): Promise<Holding[]> { const resp = await goldrush.BalanceService.getTokenBalancesForWalletAddress(chain as Chain, address, { noSpam: true, }); if (resp.error) throw new Error(resp.error_message ?? "token balances failed"); return toHoldings(resp.data.items ?? [], chain);}Step 2: Fetch balances across chains and clean them
getHoldings sends the active chains to the Multichain Wallet Balance API, which returns native and token balances for one address on up to 10 EVM chains per call, each item tagged with its chain_name. A wallet active on more than 10 chains takes one call per 10. Results come back 100 items to a page by default; for a wallet with more tokens than that, pass the response's cursor_before back as before to get the next page. If you'd rather load a chain only when the user picks it, getChainHoldings calls the single-chain Token Balance API with noSpam: true instead.
Each balance item carries everything a token row needs:
| UI field | Response field |
|---|---|
| Token name | contract_name |
| Logo | logo_url |
| Ticker | contract_ticker_symbol |
| Amount | balance ÷ 10^contract_decimals |
| Value | quote (USD by default) |
| 24h change | quote vs quote_24h (the value of balance_24h at the price 24 hours ago) |
toHoldings does the cleaning:
- Divide by decimals.
balanceis an integer in the token's smallest unit (wei for ETH), so 12.96 ETH arrives as12957712048094486472. The SDK parses it to abigint;toUnitsdivides by 10^contract_decimals. A JavaScriptnumberis fine for display; keep thebigintif you do arithmetic on amounts. - Drop spam and empty balances. Airdropped spam tokens are flagged
is_spam, and old tokens linger at zero. See how GoldRush marks spam. - Sum
quotefor net worth. Tokens without a price have anullquote, and they count as zero. - 24h change.
(quote − quote_24h) ÷ quote_24his the change in the holding's value, so it includes any tokens moved in or out in that time. For price change alone, comparequote_ratewithquote_rate_24h.
The helpers return plain numbers and strings, never bigint, because JSON.stringify can't serialize a bigint and the next step sends them as JSON.
Step 3: Get portfolio value over time
The Historical Portfolio Value API returns a wallet's daily value on one chain, broken down by token, for the last days days (30 by default). It costs 2 per 30 days per chain. The response's items[] has one entry per token, and each token's holdings[] has one entry per day with a timestamp and open, high, low and close values (balance and quote). To chart the wallet, sum close.quote across tokens for each day, and across chains:
import { goldrush } from "./goldrush";import type { Chain, PortfolioItem } from "@covalenthq/client-sdk"; export type DailyValue = { date: string; value: number }; // items[] is one entry per token, each with a holdings[] series (one row per day). Sum the closing value per day.export function dailyTotals(items: PortfolioItem[], totals = new Map<string, number>()): Map<string, number> { for (const token of items) { for (const h of token.holdings ?? []) { if (!h.timestamp) continue; const day = new Date(h.timestamp).toISOString().slice(0, 10); totals.set(day, (totals.get(day) ?? 0) + (h.close?.quote ?? 0)); } } return totals;} // Portfolio value per day over the last `days` days, summed across chains.export async function getValueHistory(address: string, chains: string[], days = 30): Promise<DailyValue[]> { const totals = new Map<string, number>(); for (const chain of chains) { const resp = await goldrush.BalanceService.getHistoricalPortfolioForWalletAddress(chain as Chain, address, { days, }); if (resp.error) throw new Error(resp.error_message ?? "portfolio history failed"); dailyTotals(resp.data.items ?? [], totals); } return [...totals].map(([date, value]) => ({ date, value })).sort((a, b) => a.date.localeCompare(b.date));}Spam tokens can carry unreliable prices. If a day looks wildly off, drop the tokens whose contract_address step 2 flagged as spam before summing.
Step 4: Serve the portfolio from one API route
One route turns an address into everything the dashboard shows on load: the active chains, the holdings and 30 days of value. It validates the address first, so a typo doesn't cost credits.
import { getValueHistory } from "@/lib/history";import { getActiveChains, getHoldings } from "@/lib/portfolio";import { NextResponse, type NextRequest } from "next/server"; const EVM_ADDRESS = /^0x[0-9a-fA-F]{40}$/; export async function GET(req: NextRequest) { const address = req.nextUrl.searchParams.get("address") ?? ""; if (!EVM_ADDRESS.test(address)) { return NextResponse.json({ error: "Pass a 0x wallet address" }, { status: 400 }); } try { const chains = await getActiveChains(address); const names = chains.map((c) => c.name); const [holdings, history] = await Promise.all([ getHoldings(address, names), getValueHistory(address, names, 30), ]); return NextResponse.json({ chains, holdings, history }); } catch (err) { return NextResponse.json({ error: (err as Error).message }, { status: 502 }); }}GET /api/portfolio?address=0x… now returns { chains, holdings, history }.
Step 5: Render the token list
The token list is the core of any wallet UI. Each row uses the fields from step 2, already cleaned:
import type { Holding } from "@/lib/portfolio"; const usd = (n: number) => n.toLocaleString("en-US", { style: "currency", currency: "USD" }); export function TokenList({ holdings }: { holdings: Holding[] }) { return ( <ul className="token-list"> {holdings.map((h) => ( <li key={`${h.chain}:${h.address}`} className="token-row"> {h.logo ? <img src={h.logo} alt="" width={32} height={32} /> : <span className="logo-fallback" />} <div> <strong>{h.name}</strong> <div> {h.amount.toLocaleString("en-US", { maximumFractionDigits: 4 })} {h.symbol} </div> </div> <div className="token-value"> <div>{usd(h.value)}</div> {h.change24h !== null && ( <div className={h.change24h >= 0 ? "up" : "down"}> {h.change24h >= 0 ? "+" : ""} {h.change24h.toFixed(2)}% </div> )} </div> </li> ))} </ul> );}Step 6: Chart the allocation and the value over time
Both charts use Recharts. The allocation donut shows each token's share of the wallet's value, the eight largest plus "Other", so long tails of small tokens don't turn it into slivers:
"use client"; import type { Holding } from "@/lib/portfolio";import { Cell, Pie, PieChart, ResponsiveContainer, Tooltip } from "recharts"; const COLORS = ["#2563eb", "#16a34a", "#f59e0b", "#dc2626", "#7c3aed", "#0891b2", "#db2777", "#65a30d", "#9ca3af"]; // Top 8 tokens by value, the rest grouped as "Other".export function allocation(holdings: Holding[]) { const priced = holdings.filter((h) => h.value > 0); const top = priced.slice(0, 8).map((h) => ({ name: h.symbol || h.name, value: h.value })); const rest = priced.slice(8).reduce((sum, h) => sum + h.value, 0); return rest > 0 ? [...top, { name: "Other", value: rest }] : top;} export function AllocationChart({ holdings }: { holdings: Holding[] }) { const data = allocation(holdings); return ( <ResponsiveContainer width="100%" height={260}> <PieChart> <Pie data={data} dataKey="value" nameKey="name" innerRadius={70} outerRadius={100} paddingAngle={2}> {data.map((d, i) => ( <Cell key={`${d.name}-${i}`} fill={COLORS[i % COLORS.length]} /> ))} </Pie> <Tooltip formatter={(v) => `$${Number(v).toLocaleString("en-US", { maximumFractionDigits: 2 })}`} /> </PieChart> </ResponsiveContainer> );}The value chart plots the daily totals from step 3 as an area chart:
"use client"; import type { DailyValue } from "@/lib/history";import { Area, AreaChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts"; export function ValueChart({ history }: { history: DailyValue[] }) { return ( <ResponsiveContainer width="100%" height={260}> <AreaChart data={history}> <XAxis dataKey="date" tickFormatter={(d: string) => d.slice(5)} /> <YAxis tickFormatter={(v: number) => `$${Math.round(v).toLocaleString("en-US")}`} width={80} /> <Tooltip formatter={(v) => `$${Number(v).toLocaleString("en-US", { maximumFractionDigits: 2 })}`} /> <Area type="monotone" dataKey="value" stroke="#2563eb" fill="#2563eb" fillOpacity={0.15} /> </AreaChart> </ResponsiveContainer> );}Step 7: Check token approvals
Every time a wallet lets a contract spend its tokens (a DEX router, a bridge, an NFT marketplace), that approval stays until it is revoked. Old unlimited approvals are a common way funds get drained. The Token Approvals API lists them for one chain, grouped by token. Each token has its spenders[], and each spender has:
spender_addressandspender_address_label(a name when the contract is known, e.g. "Uniswap V2: Router 2");allowance, the remaining amount the spender may move;value_at_risk_quote, how much the spender could take now, given the allowance and what the wallet holds;risk_factor, a label GoldRush derives from the value at risk.
import { goldrush } from "./goldrush";import type { Chain, TokensApprovalItem } from "@covalenthq/client-sdk"; export type ApprovalRow = { token: string; tokenAddress: string; spender: string; spenderLabel: string | null; allowance: string; unlimited: boolean; valueAtRisk: number; risk: string | null;}; // Max approvals come back as "UNLIMITED"; also catch a raw amount near 2^256 - 1.export function isUnlimited(allowance: string | null): boolean { if (!allowance) return false; if (allowance.toUpperCase() === "UNLIMITED") return true; return /^\d+$/.test(allowance) && BigInt(allowance) >= 2n ** 255n;} // One row per token × spender, riskiest first.export function toApprovalRows(items: TokensApprovalItem[]): ApprovalRow[] { return items .flatMap((token) => (token.spenders ?? []).map((s) => ({ token: token.ticker_symbol ?? token.token_address ?? "", tokenAddress: token.token_address ?? "", spender: s.spender_address ?? "", spenderLabel: s.spender_address_label, allowance: s.allowance ?? "", unlimited: isUnlimited(s.allowance), valueAtRisk: s.value_at_risk_quote ?? 0, risk: s.risk_factor, })) ) .sort((a, b) => b.valueAtRisk - a.valueAtRisk);} // Which contracts can still spend this wallet's tokens on one chain?export async function getApprovalRows(address: string, chain: string): Promise<ApprovalRow[]> { const resp = await goldrush.SecurityService.getApprovals(chain as Chain, address); if (resp.error) throw new Error(resp.error_message ?? "approvals failed"); return toApprovalRows(resp.data.items ?? []);}A route for one chain at a time, since it costs 2 per call per chain:
import { getApprovalRows } from "@/lib/approvals";import { NextResponse, type NextRequest } from "next/server"; export async function GET(req: NextRequest) { const address = req.nextUrl.searchParams.get("address") ?? ""; const chain = req.nextUrl.searchParams.get("chain") ?? ""; if (!/^0x[0-9a-fA-F]{40}$/.test(address) || !chain) { return NextResponse.json({ error: "Pass address and chain" }, { status: 400 }); } try { return NextResponse.json({ approvals: await getApprovalRows(address, chain) }); } catch (err) { return NextResponse.json({ error: (err as Error).message }, { status: 502 }); }}The table flags rows with an unlimited allowance or a high value at risk:
import type { ApprovalRow } from "@/lib/approvals"; const HIGH_VALUE = 1_000; // flag any spender that could take more than this (USD); pick your own threshold export function ApprovalsTable({ rows }: { rows: ApprovalRow[] }) { return ( <table> <thead> <tr> <th>Token</th> <th>Spender</th> <th>Allowance</th> <th>Value at risk</th> <th>Risk</th> </tr> </thead> <tbody> {rows.map((r) => ( <tr key={`${r.tokenAddress}:${r.spender}`} className={r.unlimited || r.valueAtRisk >= HIGH_VALUE ? "flagged" : undefined} > <td>{r.token}</td> <td title={r.spender}>{r.spenderLabel ?? `${r.spender.slice(0, 6)}…${r.spender.slice(-4)}`}</td> <td>{r.unlimited ? "Unlimited" : r.allowance}</td> <td>{r.valueAtRisk.toLocaleString("en-US", { style: "currency", currency: "USD" })}</td> <td>{r.risk}</td> </tr> ))} </tbody> </table> );}Revoking is a write, so GoldRush can't do it for the user. It means sending approve(spender, 0) on the token contract from the user's own wallet. In the app below you'd call wagmi's useWriteContract with the token's ERC-20 approve function; the same hook handles any other write, such as a mint.
Step 8: Assemble the dashboard with a chain selector
The dashboard loads /api/portfolio once. The chain buttons come from Address Activity, and picking one filters the holdings already loaded, since every multichain item carries its chain_name, so switching chains costs nothing. Picking a chain also loads that chain's approvals.
"use client"; import { AllocationChart } from "@/components/allocation-chart";import { ApprovalsTable } from "@/components/approvals-table";import { TokenList } from "@/components/token-list";import { ValueChart } from "@/components/value-chart";import type { ApprovalRow } from "@/lib/approvals";import type { DailyValue } from "@/lib/history";import type { ActiveChain, Holding } from "@/lib/portfolio";import { useEffect, useState } from "react"; type Portfolio = { chains: ActiveChain[]; holdings: Holding[]; history: DailyValue[] }; export function Dashboard({ address }: { address: string }) { const [data, setData] = useState<Portfolio | null>(null); const [chain, setChain] = useState<string | null>(null); // null = all chains const [approvals, setApprovals] = useState<ApprovalRow[] | null>(null); const [error, setError] = useState<string | null>(null); useEffect(() => { setData(null); setError(null); fetch(`/api/portfolio?address=${address}`) .then((r) => r.json()) .then((json) => (json.error ? setError(json.error) : setData(json))) .catch((e: Error) => setError(e.message)); }, [address]); useEffect(() => { setApprovals(null); if (!chain) return; fetch(`/api/approvals?address=${address}&chain=${chain}`) .then((r) => r.json()) .then((json) => setApprovals(json.approvals ?? [])); }, [address, chain]); if (error) return <p>Could not load this wallet: {error}</p>; if (!data) return <p>Loading…</p>; const shown = chain ? data.holdings.filter((h) => h.chain === chain) : data.holdings; const netWorth = shown.reduce((sum, h) => sum + h.value, 0); return ( <section> <nav className="chain-selector"> <button onClick={() => setChain(null)} aria-pressed={chain === null}> All chains </button> {data.chains.map((c) => ( <button key={c.name} onClick={() => setChain(c.name)} aria-pressed={chain === c.name}> {c.logo && <img src={c.logo} alt="" width={16} height={16} />} {c.label} </button> ))} </nav> <h2>{netWorth.toLocaleString("en-US", { style: "currency", currency: "USD" })}</h2> <AllocationChart holdings={shown} /> <TokenList holdings={shown} /> <h3>Value over the last 30 days (all chains)</h3> <ValueChart history={data.history} /> {chain && ( <> <h3>Token approvals on {chain}</h3> {approvals ? <ApprovalsTable rows={approvals} /> : <p>Loading approvals…</p>} </> )} </section> );}Step 9: Let users connect their wallet
So far the dashboard takes any address. To show the visitor's own wallet, add a Connect wallet button with RainbowKit, which handles wallet selection and connection on top of wagmi. RainbowKit 2 needs wagmi 2 and viem 2, so pin them:
npm install @rainbow-me/rainbowkit wagmi@2 viem@2.x @tanstack/react-queryGet a free WalletConnect project ID from the Reown dashboard (formerly WalletConnect Cloud), add it to .env.local as NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID, and wrap the app in the three providers. The chains here are the ones the wallet can connect on; they don't limit what the tracker reads, which comes from Address Activity.
"use client"; import { getDefaultConfig, RainbowKitProvider } from "@rainbow-me/rainbowkit";import "@rainbow-me/rainbowkit/styles.css";import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { useState, type ReactNode } from "react";import { WagmiProvider } from "wagmi";import { arbitrum, base, mainnet, optimism, polygon } from "wagmi/chains"; const config = getDefaultConfig({ appName: "Portfolio tracker", projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID ?? "", chains: [mainnet, polygon, optimism, arbitrum, base], ssr: true,}); export function Providers({ children }: { children: ReactNode }) { const [queryClient] = useState(() => new QueryClient()); return ( <WagmiProvider config={config}> <QueryClientProvider client={queryClient}> <RainbowKitProvider>{children}</RainbowKitProvider> </QueryClientProvider> </WagmiProvider> );}import { Providers } from "./providers";import type { ReactNode } from "react"; export default function RootLayout({ children }: { children: ReactNode }) { return ( <html lang="en"> <body> <Providers>{children}</Providers> </body> </html> );}Then useAccount() gives the connected address, which goes straight into the dashboard:
"use client"; import { Dashboard } from "@/components/dashboard";import { ConnectButton } from "@rainbow-me/rainbowkit";import { useAccount } from "wagmi"; export default function Home() { const { address } = useAccount(); return ( <main> <ConnectButton /> {address ? <Dashboard address={address} /> : <p>Connect a wallet to see its portfolio.</p>} </main> );}Run npm run dev, connect a wallet, and the tracker loads its chains, tokens, charts and, per chain, approvals. To deploy, set GOLDRUSH_API_KEY and NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID in your host's environment variables.
What a dashboard load costs
One load calls Address Activity once (0.5 per call), the Multichain Wallet Balance API once per 10 chains (2.5 per call for the first page) and the Historical Portfolio Value API once per chain (2 per 30 days). For a wallet active on 3 chains that is 9 credits. Loading balances per chain with the Token Balance API instead (1 per call each) makes it 9.5 credits. Approvals add 2 per call for each chain the user opens. Cache responses for a few minutes per address to avoid paying twice for a refresh, and use the pricing calculator to estimate a month.
Frequently asked questions
How do I track a crypto portfolio across multiple chains?
Call the Address Activity API to find the chains the wallet has used, then fetch balances for just those chains: with the Multichain Wallet Balance API (up to 10 chains per call) or the Token Balance API per chain. Sum each token's quote for net worth, and sum the Historical Portfolio Value API's daily totals for a value-over-time chart.
How do I find which chains a wallet is active on?
Use the Address Activity API (GET /v1/address/{walletAddress}/activity/, AllChainsService.getAddressActivity in the SDK). It returns every chain the address has activity on in one call, with each chain's name, label, logo and when the address was last seen there. It costs 0.5 per call.
Why are the token balances such huge numbers?
balance is in the token's smallest unit, like wei for ETH. Divide it by 10 to the power of contract_decimals (18 for ETH, 6 for USDC) to get whole tokens. The quote field is already in dollars (or the quote currency you asked for), so value needs no conversion.
Can GoldRush revoke a token approval?
No. GoldRush is read-only: the Token Approvals API tells you which spenders have an allowance and how much is at risk, but revoking is a transaction. The user sends approve(spender, 0) on the token contract from their own wallet, for example through wagmi's useWriteContract.
Can the tracker show NFTs and profit and loss?
Yes, with two more calls. The NFT Wallet API lists the NFTs an address holds on a chain (1 per call); the NFT API guide covers it. For gains and losses on what the wallet holds, see how to calculate unrealized profit and loss.
Next steps
- Read the Multichain Wallet Balance API reference for quote currencies and historical snapshots (
cutoffTimestamp). - Add NFTs with the NFT Wallet API.
- Add profit and loss with the unrealized PnL guide.
- Track Bitcoin wallets too with the Bitcoin wallet lookup guide.
- See what GoldRush offers as a crypto wallet API for wallets and portfolio apps.