> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solanatracker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How Solana wallet PnL works

> Understand Solana Tracker PnL V2 coverage, calculation modes, currencies, pagination, wallet identity, and live updates.

PnL V2 measures wallet returns from indexed Solana trades. Before comparing wallets, choose the same calculation mode, currency, and time window. This page explains those choices and links to the query guides.

> [!NOTE]
>
> **Base URL:** `https://data.solanatracker.io`\
> **Auth:** Pass your API key in the `x-api-key` header.\
> **Values:** Monetary amounts default to USD. Wallet summary, history, and performance accept `?currency=usd|sol|eur`. Timestamps are Unix milliseconds unless noted.

## Essentials

### What PnL V2 includes

* **Token coverage.** Every SPL token is supported **except stablecoins and SOL**.
* **Wallet endpoints.** Use wallet endpoints for any wallet, even if it is not on a leaderboard.
* **Identity tags.** Wallets can include an `identity` object with labels such as KOL, bot, exchange, pool, developer, trading platform, or SNS primary `.sol` domain.

### What PnL V2 excludes

SOL and stablecoins serve as quote assets and are excluded from PnL positions.

`excludeArbitrage=true` is the default on endpoints that expose this filter. Set it to `false` when your analysis needs arbitrage wallets.

The top-traders leaderboard covers the **top 500k wallets** per period. If a wallet is outside that ranked set, query it directly with the wallet endpoints.

### Identity tags

An `identity` object can contain several labels:

* **Bots and MEV** — `potential_bot` (heuristic), `bot` (curated named bots like Mayhem Bot), and `arbitrage` (confirmed MEV).
* **Platforms** — `axiom`, `bloom`, and `photon`. The API also accepts `axiom-flash` as an `axiom` alias.
* **Safety / infrastructure tags** — curated `hacker`, `spam_dusting`, and `exchange` labels when known.
* **Pool and developer** roles are automatically resolved on token-scoped endpoints.
* **SNS:** primary `.sol` domain via Ridge (`identity.sns`, `sns` tag). See [SNS Primary Domain](https://docs.solanatracker.io/guides/pnl-v2/sns-identity.md).

### PnL modes

Wallet-summary, positions, single-position, top-trader leaderboard, and position batch endpoints accept `?pnlMode=`.

| Mode | Behavior |
| - | - |
| `strict` (default) | Excludes positions with recorded sells greater than recorded buys. |
| `adjusted` | Keeps those positions but recalculates realized PnL with an adjusted cost basis. Useful when strict mode hides positions you still want to show. |
| `raw` | No filtering. Realized PnL is returned exactly as calculated. Use this when you need the unfiltered numbers. |

Supported endpoints echo `pnlMode` in the response. Position rows expose mode-aware `pnl.realized` and unfiltered `pnl.realizedRaw`; read the selected mode when comparing results.

The KOL leaderboards, history, chart, performance, highlights, risk, token-traders, first-buyers, and wallet-summary batch endpoints do not take `pnlMode`; they return the API's fixed server-side view for that dataset.

### Currency denomination

Wallet summary, history, and performance accept an optional `?currency=` query parameter:

| Value | Behavior |
| - | - |
| `usd` (default) | Monetary fields are returned in USD. The `currency` field is omitted. |
| `sol` | USD snapshot values are converted at read time using SOL/USD reference prices. Response includes `"currency": "sol"`. |
| `eur` | USD snapshot values are converted at read time using EUR/USD reference prices. Response includes `"currency": "eur"`. |

Conversion rules:

* **History** and **performance** — each day's USD values are divided by that day's historical reference rate.
* **Wallet summary** — converted with current spot (`getSolanaPrice()` for SOL; latest 1m candle for EUR).
* Counts, percentages, timestamps, and ROI are **not** converted.
* Field names stay the same (e.g. `activity.volume.costUsd`); check the top-level `currency` field for denomination.
* Invalid values (e.g. `?currency=btc`) return **400**: `{ "error": "Invalid currency. Options: usd, sol, eur" }`.

## Endpoint groups

### Wallet endpoints

| Endpoint | What it returns |
| - | - |
| [GET /v2/pnl/wallets/\{wallet}](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-summary.md) | PnL summary, win rate, token counts |
| [GET /v2/pnl/wallets/\{wallet}/positions](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-positions.md) | All positions with sorting and filters |
| [GET /v2/pnl/wallets/\{wallet}/tokens/\{token}](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-token-position.md) | Single position detail |
| [GET /v2/pnl/wallets/\{wallet}/history](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-pnl-calendar.md) | Daily PnL snapshots |
| [GET /v2/pnl/wallets/\{wallet}/chart](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-chart.md) | Chart data points |
| [GET /v2/pnl/wallets/\{wallet}/performance](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-performance.md) | Streaks, drawdown, best/worst days |
| [GET /v2/pnl/wallets/\{wallet}/highlights](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-highlights.md) | Biggest winners, losers, flips |
| [GET /v2/pnl/wallets/\{wallet}/risk](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-risk.md) | Concentration and open exposure |

### Token endpoints

| Endpoint | What it returns |
| - | - |
| [GET /v2/pnl/tokens/\{token}/traders](https://docs.solanatracker.io/data-api/pnl-v2/token/get-token-traders.md) | Every wallet that traded this token |
| [GET /v2/pnl/tokens/\{token}/first-buyers](https://docs.solanatracker.io/data-api/pnl-v2/token/get-token-first-buyers.md) | Earliest buyers only (`sort=first_trade`, `direction=asc`) |

### Leaderboard endpoints

| Endpoint | What it returns |
| - | - |
| [GET /v2/pnl/leaderboard/kols](https://docs.solanatracker.io/data-api/pnl-v2/leaderboard/get-kol-leaderboard.md) | KOL rankings (all-time) |
| [GET /v2/pnl/leaderboard/kols/period](https://docs.solanatracker.io/data-api/pnl-v2/leaderboard/get-kol-leaderboard-for-a-period.md) | KOL rankings for a time window |
| [GET /v2/pnl/leaderboard/kols/calendar](https://docs.solanatracker.io/data-api/pnl-v2/leaderboard/get-kol-calendar.md) | Daily KOL performance for a month |
| [GET /v2/pnl/leaderboard/kols/date](https://docs.solanatracker.io/data-api/pnl-v2/leaderboard/get-kol-daily-breakdown.md) | Per-KOL breakdown for one day |
| [GET /v2/pnl/leaderboard/top](https://docs.solanatracker.io/data-api/pnl-v2/leaderboard/solana-traders-leaderboard.md) | Solana Traders Leaderboard over a rolling window |

### Batch endpoints

| Endpoint | What it returns |
| - | - |
| [POST /v2/pnl/wallets/\{wallet}/positions/batch](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-batch-positions.md) | One wallet → many tokens |
| [POST /v2/pnl/tokens/\{token}/positions/batch](https://docs.solanatracker.io/data-api/pnl-v2/token/get-token-batch-positions.md) | One token → many wallets |
| [POST /v2/pnl/positions/batch](https://docs.solanatracker.io/data-api/pnl-v2/batch/get-position-batch-lookup.md) | Any wallet-token pairs |
| POST /v2/pnl/wallets/batch | Wallet summaries + tags for up to 100 wallets |

## Key concepts

### Realized vs unrealized PnL

> [accordion] Realized PnL
>
> Profit or loss attributed to completed sales.

> [accordion] Unrealized PnL
>
> The current value of open positions minus their remaining cost basis.

> [accordion] Total PnL
>
> `realized + unrealized`.

### Wallet coverage

PnL V2 covers all Solana wallets from **December 2023 onward**. Wallets are not indexed on request.

### Pagination

For paginated responses, pass `pagination.nextCursor` unchanged as `cursor` in the next request. Keep the other filters the same.

```bash theme={null}
# First page
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/positions?limit=50" \
  -H "x-api-key: YOUR_API_KEY"

# Next page (use cursor from previous response)
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/positions?limit=50&cursor=eyJ..." \
  -H "x-api-key: YOUR_API_KEY"
```

### Wallet identity

When available, `identity` combines wallet labels from multiple sources. For example, a wallet may have `["kol", "developer", "axiom"]`. Only populated fields are returned:

| Tag | Meaning |
| - | - |
| `kol` | Tracked KOL wallet. Includes `name`, `twitter`, `avatar`. |
| `bot` | Curated named bot (e.g. Mayhem Bot). |
| `potential_bot` | Heuristically detected bot — softer signal. |
| `arbitrage` | Confirmed MEV / arbitrage operator. |
| `hacker` | Curated exploit / scam wallet label. Includes `hacker.label`. |
| `spam_dusting` | Curated spam-dusting wallet label. Includes `spamDusting.label`. |
| `exchange` | Known centralized exchange hot wallet. Includes `exchange.name`. |
| `pool` | Wallet is a pool vault, authority, LP mint, or bonding curve account. Includes `program` and `poolAddress`. |
| `developer` | Wallet is a token creator, pool deployer, or mint authority. Includes `via`, `pools`, `creationTx`, `createdAt`. |
| Platform tags | `axiom`, `bloom`, `photon`. `axiom-flash` is accepted as a query alias and surfaces as `axiom`. |
| `sns` | Primary `.sol` domain for the wallet (Solana Name Service). Includes `sns.domain`. |

On token-scoped endpoints (`/tokens/:token/traders`, `/first-buyers`, `/tokens/:token/positions/batch`) the `pool` and `developer` roles are resolved for the exact token in the path, so you can spot devs, LPs, and snipers inline without extra requests. See the [Solana Wallet Tags guide](https://docs.solanatracker.io/guides/pnl-v2/wallet-tags.md) for the full supported tag list.

### Enrichment on `/tokens/:tokenAddress/holders`

The classic holders endpoint accepts an optional `?enrich=` parameter:

* `?enrich=identity` — adds pool / developer / platform identity per holder.
* `?enrich=walletPnl` — adds lifetime wallet PnL plus per-token PnL per holder.
* `?enrich=all` — both.

Omit `enrich` when you only need the base holder response.

### Real-time via Datastream

Pair these REST endpoints with the Datastream PnL V2 WebSocket rooms for live updates. Available on Premium, Business, and Enterprise plans:

| Room | Emits | Scope |
| - | - | - |
| `pnl:{wallet}:{token}` | `tradeUpdate`, `balanceUpdate` | One token position |
| `pnl:{wallet}` | `tradeUpdate`, `balanceUpdate` | Every token the wallet trades |
| `pnl:{wallet}:summary` | Total wallet PnL summary | Aggregated realized/unrealized PnL, ROI, counts, averages, and open-position totals |

Typical pattern: call `GET /v2/pnl/wallets/:wallet` once to seed state, then subscribe to `pnl:{wallet}:summary` to keep it in sync.

For valuations between position events, combine a PnL room with `price:aggregated:{token}` or `price-by-token:{token}`. Use PnL events for balances and cost basis, and price events for the displayed market value. Follow the [live PnL guide](https://docs.solanatracker.io/guides/datastream-pnl.md#fastest-live-unrealized-pnl-combining-rooms).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.