Skip to content

GET /v1/portfolio/pnl/:walletAddress

Return a wallet's portfolio value change over the last 24 hours — the USD value of its holdings now versus 24 hours ago, plus a per-asset breakdown. Useful for portfolio dashboards and "you're up/down today" tiles.

This is a value change, not trading PnL: deposits and withdrawals move the number too (a deposit reads as an increase, a withdrawal as a decrease). It answers "is my wallet worth more than yesterday?", not "how much did I make trading?". Cost-basis / realized-vs-unrealized accounting is not included.

Holdings are valued with live DEX prices (the same source as /v1/prices); the 24h-ago value reconstructs each asset's balance from the wallet's transaction activity in the window and prices it with the 24h-ago price. Only tracked mints (those returned by /v1/balances) are valued.

Request

http
GET /v1/portfolio/pnl/:walletAddress
x-api-key: YOUR_API_KEY

Path parameters

FieldTypeDescription
walletAddressstringBase58 wallet pubkey (32-44 chars)

Example

bash
curl https://api.venum.dev/v1/portfolio/pnl/Fgz6qLgeibJPNkNdALqvrYQ9FauLanTKs15miEsAiHqh \
  -H 'x-api-key: YOUR_API_KEY'

Response

200 OK

json
{
  "wallet": "Fgz6qLgeibJPNkNdALqvrYQ9FauLanTKs15miEsAiHqh",
  "valueNowUsd": 12500.5,
  "value24hAgoUsd": 12000.25,
  "changeUsd": 500.25,
  "changePct": 4.17,
  "assets": [
    {
      "mint": "So11111111111111111111111111111111111111112",
      "symbol": "SOL",
      "decimals": 9,
      "balanceNow": 100.5,
      "balance24hAgo": 100.0,
      "priceNow": 80.31,
      "price24hAgo": 78.5,
      "valueNowUsd": 8071.31,
      "value24hAgoUsd": 7850.0,
      "changeUsd": 221.31
    }
  ],
  "stats": {
    "windowHours": 24,
    "rpcPosts": 12,
    "signaturesScanned": 42,
    "txHydrated": 42,
    "truncated": false,
    "elapsedMs": 3250
  },
  "fetchedAt": 1733587200000
}

Top-level fields

FieldTypeDescription
walletstringThe queried wallet
valueNowUsdnumberTotal USD value of current holdings
value24hAgoUsdnumberTotal USD value of holdings as they stood 24 h ago
changeUsdnumbervalueNowUsd − value24hAgoUsd (signed)
changePctnumber | nullPercent change vs 24 h ago; null when the 24h-ago value was zero
assetsarrayPer-asset breakdown, sorted by valueNowUsd descending
fetchedAtnumberUNIX millisecond timestamp the computation started

Asset object

FieldTypeDescription
mintstringBase58 mint address
symbolstringTracked symbol (e.g. "SOL", "USDC")
decimalsnumberToken decimals
balanceNownumberCurrent balance (human-readable)
balance24hAgonumberReconstructed balance 24 h ago (balanceNow − net flow)
priceNownumber | nullCurrent USD price; null if the asset can't be priced
price24hAgonumber | nullUSD price 24 h ago; falls back to priceNow when no 24h % data
valueNowUsdnumberbalanceNow × priceNow
value24hAgoUsdnumberbalance24hAgo × price24hAgo
changeUsdnumbervalueNowUsd − value24hAgoUsd

Stats object

FieldTypeDescription
windowHoursnumberThe lookback window (24)
rpcPostsnumberRPC requests issued for the transaction scan
signaturesScannednumberSignatures examined inside the window
txHydratednumberTransactions fully fetched to compute balance deltas
truncatedbooleantrue if the wallet had more window activity than the scan cap — the 24h-ago figure is then a partial reconstruction
elapsedMsnumberServer compute time

Notes:

  • An asset held 24 h ago but fully sold during the window (zero balance now) still appears, contributing to value24hAgoUsd.
  • Assets with no priceable market are included with priceNow: null and contribute 0 to the USD totals.
  • When an asset has no 24h price-change data, its price24hAgo falls back to the current price, so its contribution reflects only the change in quantity, not a fabricated price move.
  • A truncated: true result means a very active wallet exceeded the scan cap; treat value24hAgoUsd / changeUsd as approximate.

Errors

StatusDescription
400Invalid wallet address (not a valid pubkey)
401Missing or invalid API key
429Rate limit exceeded
503Temporarily unavailable (upstream RPC); retry after the Retry-After header

Auth

Requires API key.

Rate Limit

Dedicated limits (per minute) — lower than /v1/balances because the 24h transaction-history scan makes this endpoint significantly heavier:

TierLimit
anonymous0
free5
starter30
growth75
pro150