Anatomy of the Wallet PnL endpoint
Returns PnL analytics for a wallet: unrealized PnL, realized PnL, net invested amount, total fees, and received/sent value, using FIFO (First In, First Out) trade matching by default — with other matching strategies available on request.
curl "https://api.zerion.io/v1/wallets/0xabc.../pnl" \
-H "authorization: Basic <API_KEY>" \
-G -d "currency=usd"{
"data": {
"type": "wallet-pnl",
"attributes": {
"unrealized_gain": 8241.10,
"realized_gain": 3120.55,
"net_invested": 21000.00,
"total_fee": 412.83
}
}
}Key parameters
addresspathEVM or Solana wallet address to analyze.currencyqueryDenomination for PnL values. Defaults to usd.filter[chain_ids]queryComma-separated chain slugs to scope the calculation.filter[fungible_ids]queryRestrict PnL to specific assets by id.What the Wallet PnL response gives you
One request returns enriched, ready-to-render fields — no decoding, pricing, or post-processing on your side.
Total, realized & unrealized
Three headline gain figures, computed and ready to display.
unrealized_gainPercentage returns
Relative return on total, realized and open positions.
relative_total_gain_percentageInvested & net invested
What was spent overall and what's tied up in current holdings.
net_investedFees & transfers
Total fees, external in/out and value exchanged for NFTs.
total_feePer-asset breakdown
The same metrics scoped to each asset, by id or implementation.
breakdown.by_idCost-basis matching
FIFO by default — earliest buys matched to earliest sells; other strategies on request.
realized_cost_basisBuilt for production
Everything the Wallet PnL endpoint gives you to ship a real integration — filters, coverage, and predictable limits.
Cost basis, the way accountants expect
PnL uses FIFO (First In, First Out) trade matching by default — oldest purchases matched to earliest sales — and the engine supports other matching strategies on request, so realized and unrealized figures are accurate and defensible.
- FIFO matching by default — other strategies on request
- Realized = matched buys vs sells
- Unrealized = market value − matched cost of holdings
Any window, any asset set
Scope PnL to specific chains, assets or a custom date range.
- since / till — millisecond timestamps
- filter[chain_ids] — up to 25 chains
- filter[fungible_ids] — up to 100 assets
Pre-computed for instant reads
PnL is precomputed at standard marks, so common queries return immediately.
- Marks: now, 1d, 1w, 1m, 1y, year-to-date
- Custom timestamps under 3,000 txs from a mark
- Priceless assets auto-excluded, listed in meta
Built for real wallets
Clear constraints keep results correct and fast.
- First request may return 503 — retry shortly
- Wallets over 1M transactions unsupported
- Max 25 chains, 100 assets per filter
What teams build with it
From dashboards to autonomous agents, teams reach for the Wallet PnL endpoint to ship faster.
Performance dashboards
Show realized and unrealized gains per wallet without building a cost-basis engine.
Tax reporting
Use cost-basis PnL and net invested figures as the basis for tax and accounting exports.
Trading analytics
Benchmark wallet performance across chains with consistent, comparable numbers.
Other endpoints
PnL (Profit and Loss)
Calculate historical gains, losses, and invested value per EVM & Solana wallet or position.
One API, every major chain
Ethereum, Base, Solana, Arbitrum and 45+ more networks — queried in a single call.
Why builders choose the
Wallet PnL API
Ship faster
Go live in minutes, not months
Grab a free key, paste one request, and you're serving portfolio data. No nodes, no indexers, no infra to maintain.
Speed
Fast everywhere your users are
A globally cached edge keeps every query fast, so your app feels instant no matter where your users open it.
Freshness
Balances update in seconds
Balances, positions, and transactions land within seconds of confirmation. Never stale, never guessing.
Scale
Scale from one user to millions
One request spans Solana, Ethereum, Base and 50+ chains. The same endpoint carries your first user and your millionth.
Built for Consumer Scale and Enterprise Reliability
The same infrastructure that runs the Zerion wallet — sized for everything from a first prototype to fintech products in production.
Stay ahead with the Zerion API
New endpoints, chains, and webhooks — straight to your inbox.
Simple, transparent tiers
Start building for free. Upgrade as you scale.
For early prototypes and proofs of concept
Get Started Free- 2K requests / day
- 3 RPS limit
- Chat widget
- Best effort support
For shipping MVP without running any Infrastructure
Start building- Up to 250K requests / month
- 10 RPS
- Telegram group
- Priority support
For apps preparing for launches or already in production
Start building- Up to 1M requests / month
- 25 RPS
- Slack or Telegram channel
- Priority support
Custom pricing & features
For scale-ups & enterprises with high volume or custom needs
Contact salesDeFi Positions, Wallet Portfolio Chart, and Wallet P&L endpoints are limited to 25% of every plan quota and aren’t covered by overages.
What can you build?
Wallets & Stablecoins
Power portfolio views, transaction history, and in-app swaps with one API — across every chain and stablecoin your users hold.

Fintech & Neobanks
Add portfolio charts, PnL, and transaction history to your app — no blockchain node to stand up, no infra to maintain.

AI Agents
Wallet holdings, DeFi positions, and PnL in a single call. Pay per request with x402 on Base — no subscriptions, no keys.

Trusted by the companies you know
From multichain wallets to onchain apps — teams build on Zerion API.
Built for developers.
Trusted by enterprises.
Give wallets, AI agents, and consumer apps reliable access to wallets, positions, transactions, and DeFi data across chains.
FAQ
If you have any questions




.da6f4144.webp)
