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>"
Parameters
ParameterDescription
wallets

query · 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).
chain

path · 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.
mint

path · 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.

Response fields of Wallet profit on one token
FieldTypeDescription
tradersobject[]One entry per requested wallet, in the order given (after de-duplication) — never omitted, even when the source found no activity for it.
traders[].walletstring
traders[].tradedboolean | nullWhether 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[].pnlWindowstring | nullThe 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[].buysnumber | nullCount of buys.
traders[].sellsnumber | nullCount of sells.
traders[].tradesnumber | nullTotal trade count.
traders[].tokensBoughtnumber | nullDecimalized TOKEN units bought — not USD.
traders[].tokensSoldnumber | nullDecimalized token units sold.
traders[].tokensHeldnumber | nullCurrent holding, decimalized token units.
traders[].investedUsdnumber | nullUSD spent buying.
traders[].proceedsUsdnumber | nullUSD received from selling.
traders[].costBasisSoldUsdnumber | nullUSD cost basis of the tokens that have been sold. Close to, but not asserted to equal, investedUsd.
traders[].currentValueUsdnumber | nullUSD value of what is still held, at currentPriceUsd.
traders[].realizedPnlUsdnumber | nullProfit 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[].realizedPnlPctnumber | nullrealizedPnlUsd 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[].unrealizedPnlUsdnumber | nullPaper gain or loss on tokensHeld, marked to currentPriceUsd.
traders[].unrealizedPnlPctnumber | nullunrealizedPnlUsd 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[].totalPnlUsdnumber | nullrealizedPnlUsd + unrealizedPnlUsd.
traders[].totalPnlPctnumber | nulltotalPnlUsd 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[].avgProfitPerTradeUsdnumber | nullAverage realised profit per trade, in USD.
traders[].currentPriceUsdnumber | nullThis token's current price, in USD — what currentValueUsd is marked to.
traders[].avgBuyPriceUsdnumber | nullAverage price paid per token unit across all buys, in USD.
traders[].avgSellPriceUsdnumber | nullAverage 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