Tokens API
Wallet profit on one token
How much each of a caller-supplied list of wallets has made or lost trading ONE token; the inverse of wallet PnL. SOL, ETH, BNB, BASE, RHC and STABLE.
GET
/api/external/token-analysis/token-trader-pnl/{chain}/{mint}Chains
- Solana SOL
- BNB Chain BNB
- Ethereum ETH
- Stable STABLE
- Base BASE
- Robinhood Chain RHC
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -H "x-dex-data-key: $DEXDATA_API_KEY" \ "https://api.dexdata.io/api/external/token-analysis/token-trader-pnl/SOL/<mint>?wallets=<wallets>"
| Parameter | Description |
|---|---|
walletsquery · string · required | Comma-separated wallet addresses to score against this token, e.g. "Aa...,Bb..." — base58 on Solana, 0x-prefixed hex on every other chain. De-duplicated before counting (order preserved). Capped at 50 distinct addresses per request — the source's own hard ceiling on this call (enforced after the API-key gate, not declared as a schema maximum). |
chainpath · string · required | SOL, ETH, BNB, BASE, RHC and STABLE; every other chain returns 400. On ETH, BNB, BASE and RHC no current balance is known, so tokensHeld, currentValueUsd, the unrealized and total figures and avgProfitPerTradeUsd are null. On STABLE every figure covers the last year only, and costBasisSoldUsd, the unrealized and total figures and avgProfitPerTradeUsd are null. |
mintpath · string · required | The token address (the mint, on Solana). |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
traders | object[] | One entry per requested wallet, in the order given (after de-duplication) — never omitted, even when the source found no activity for it. |
traders[].wallet | string | |
traders[].traded | boolean | null | Whether any trading record was found for this wallet on this token. false is a confirmed answer (every source asked answered and this wallet was absent) — null means it could not be established either way: a request could not be completed, or the wallet is known on this token but none of its trades could be attributed to it (seen on ERC-4337 smart accounts on EVM chains). Every other field below is null in BOTH of those cases. |
traders[].pnlWindow | string | null | The window every count and figure in this entry covers: lifetime (all indexed history) or 1y (the last year only). Always 1y on STABLE; on other EVM chains an ERC-4337 smart account is answered from a one-year source too. null exactly when traded is not true. |
traders[].buys | number | null | Count of buys. |
traders[].sells | number | null | Count of sells. |
traders[].trades | number | null | Total trade count. |
traders[].tokensBought | number | null | Decimalized TOKEN units bought — not USD. |
traders[].tokensSold | number | null | Decimalized token units sold. |
traders[].tokensHeld | number | null | Current holding, decimalized token units. |
traders[].investedUsd | number | null | USD spent buying. |
traders[].proceedsUsd | number | null | USD received from selling. |
traders[].costBasisSoldUsd | number | null | USD cost basis of the tokens that have been sold. Close to, but not asserted to equal, investedUsd. |
traders[].currentValueUsd | number | null | USD value of what is still held, at currentPriceUsd. |
traders[].realizedPnlUsd | number | null | Profit already taken out. Null when the wallet sold tokens it never bought on this token (received by transfer), since there is then no cost to measure profit against. |
traders[].realizedPnlPct | number | null | realizedPnlUsd expressed as a percentage of cost. Already a percentage, not a 0-1 fraction, and NOT bounded by 100 — a wallet up 90x on its cost basis reads 8944.2, measured live. Never clamp, never divide by 100. |
traders[].unrealizedPnlUsd | number | null | Paper gain or loss on tokensHeld, marked to currentPriceUsd. |
traders[].unrealizedPnlPct | number | null | unrealizedPnlUsd expressed as a percentage of cost. Already a percentage, not a 0-1 fraction, and NOT bounded by 100 — a wallet up 90x on its cost basis reads 8944.2, measured live. Never clamp, never divide by 100. |
traders[].totalPnlUsd | number | null | realizedPnlUsd + unrealizedPnlUsd. |
traders[].totalPnlPct | number | null | totalPnlUsd expressed as a percentage of cost. Already a percentage, not a 0-1 fraction, and NOT bounded by 100 — a wallet up 90x on its cost basis reads 8944.2, measured live. Never clamp, never divide by 100. |
traders[].avgProfitPerTradeUsd | number | null | Average realised profit per trade, in USD. |
traders[].currentPriceUsd | number | null | This token's current price, in USD — what currentValueUsd is marked to. |
traders[].avgBuyPriceUsd | number | null | Average price paid per token unit across all buys, in USD. |
traders[].avgSellPriceUsd | number | null | Average price received per token unit across all sells, in USD. |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key