> ## 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.

# Solana wallet PnL API: summaries and token positions

> Get wallet PnL summaries, token positions, daily history, charts, performance, and exposure with Solana Tracker PnL V2.

Fetch a wallet summary for total returns, then query positions for the tokens behind those numbers. Use history for daily changes, charts for a time series, and risk data for current exposure.

## Wallet summary

The [wallet summary](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-summary.md) returns total PnL, win rate, token counts, and ROI distribution.

```bash cURL theme={null}
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}" \
  -H "x-api-key: YOUR_API_KEY"
```

```javascript JavaScript theme={null}
const wallet = "CyaE1VxvBrahnPWkqm5VsdCvyS2QmNht2UFrKJHga54o";

const res = await fetch(`https://data.solanatracker.io/v2/pnl/wallets/${wallet}`, {
  headers: { "x-api-key": "YOUR_API_KEY" }
});
const data = await res.json();

console.log(`Total PnL: $${data.summary.pnl.total.toFixed(2)}`);
console.log(`Win Rate: ${data.analysis.winRate}%`);
console.log(`Tokens Traded: ${data.summary.counts.tokensTraded}`);
```

```python Python theme={null}
import requests

wallet = "CyaE1VxvBrahnPWkqm5VsdCvyS2QmNht2UFrKJHga54o"
res = requests.get(
    f"https://data.solanatracker.io/v2/pnl/wallets/{wallet}",
    headers={"x-api-key": "YOUR_API_KEY"}
)
data = res.json()

print(f"Total PnL: ${data['summary']['pnl']['total']:.2f}")
print(f"Win Rate: {data['analysis']['winRate']}%")
```

## Currency denomination

Wallet summary, history, and performance support `?currency=usd|sol|eur` (default `usd`). When you pass `sol` or `eur`, monetary values are converted at read time and the response includes a top-level `"currency"` field.

```bash SOL denomination theme={null}
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}?currency=sol" \
  -H "x-api-key: YOUR_API_KEY"
```

```bash EUR denomination (30-day history) theme={null}
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/history?period=30d&currency=eur" \
  -H "x-api-key: YOUR_API_KEY"
```

```bash Performance in SOL theme={null}
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/performance?period=30d&currency=sol" \
  -H "x-api-key: YOUR_API_KEY"
```

> [!NOTE]
>
> Historical SOL/EUR values are approximate — each day uses that day's reference rate, so cumulative converted values won't chain perfectly across days. Field names stay USD-oriented in some places (e.g. `activity.volume.costUsd`); use the top-level `currency` field to determine denomination.

## Token positions

The [positions endpoint](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-positions.md) lists every token a wallet has traded. Sort by PnL, ROI, or value. Filter by holding state, market, minimum invested amount, and more.

### PnL mode

The wallet summary, positions, and single-position endpoints support `?pnlMode=strict|adjusted|raw`. Default is `strict`, which filters out positions with sell amounts greater than buy amounts (usually invalid). Switch to `adjusted` for a cost-basis-corrected view, or `raw` to see everything unfiltered. See the [Essentials](https://docs.solanatracker.io/guides/pnl-v2/overview.md#essentials) for details.

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

### Common filters

> [accordion] Show only profitable positions
>
> ```bash theme={null}
> GET /v2/pnl/wallets/{wallet}/positions?filter=profit&sort=total&direction=desc
> ```

> [accordion] Show currently held tokens
>
> ```bash theme={null}
> GET /v2/pnl/wallets/{wallet}/positions?filter=holding&sort=value&direction=desc
> ```

> [accordion] Filter by minimum investment
>
> ```bash theme={null}
> GET /v2/pnl/wallets/{wallet}/positions?minInvested=100&sort=roi&direction=desc
> ```

> [accordion] Filter by specific market (e.g. pump.fun)
>
> ```bash theme={null}
> GET /v2/pnl/wallets/{wallet}/positions?market=pumpfun&sort=total&direction=desc
> ```

### Single position

Use the [wallet token position](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-token-position.md) endpoint for one mint:

```bash theme={null}
GET /v2/pnl/wallets/{wallet}/tokens/{token}
```

Returns the full position: realized/unrealized PnL, cost basis, current value, buy/sell counts, trade timing, and token metadata.

## PnL calendar

The [PnL calendar endpoint](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-pnl-calendar.md) shows how a wallet's PnL changed day by day.

![PnL calendar showing daily green and red profit and loss cells](https://mintcdn.com/solanatracker/ZM5vWoSAJUJFeh6A/images/guides/pnl-calendar.png?fit=max\&auto=format\&n=ZM5vWoSAJUJFeh6A\&q=85\&s=32e956ede9e011871af7d0e29df564b2)

```bash Last 30 days theme={null}
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/history?period=30d" \
  -H "x-api-key: YOUR_API_KEY"
```

```bash Custom date range theme={null}
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/history?start=2025-01-01&end=2025-01-31" \
  -H "x-api-key: YOUR_API_KEY"
```

Each day includes:

* **Running totals** — PnL, invested, and proceeds as of that day
* **Daily activity** — that day's realized PnL, volume, and trade counts

> [!TIP]
>
> Use **history** when you need to explain what changed each day. Use **chart** when you need a visual equity curve.

### Choosing a time window

Time-range parameters vary by endpoint. Use the following options for history, performance, charts, and KOL period queries:

| Parameter | Where it works | Notes |
| - | - | - |
| `period` | history, performance, KOL period | Shorthand enum: `1d`, `7d`, `14d`, `30d`, `90d`, `all`. Ignored when `start`/`end` are set. |
| `days` | performance | Integer number of days (default `30`, max `365`). Use this to ask for non-standard windows like `45` or `120`. |
| `start` / `end` | history, KOL period | Explicit `YYYY-MM-DD` calendar range. When either is set, `period` is ignored. Defaults: `start` = 30 days ago, `end` = today. |
| `time_from` / `time_to` | chart | Unix seconds. Pass `pagination.nextTimeTo` as `time_to` to load older points. |

Use `period` or `days` only where the endpoint supports it. Pass `start` and `end` for an explicit date range on history and KOL period queries.

## Chart data

The [chart endpoint](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-chart.md) returns up to 180 daily data points for plotting equity, realized PnL, and activity.

![PnL chart showing realized profit over time, volume, win rate, and drawdown](https://mintcdn.com/solanatracker/ZM5vWoSAJUJFeh6A/images/guides/pnl-chart.png?fit=max\&auto=format\&n=ZM5vWoSAJUJFeh6A\&q=85\&s=9a2eb20d19fc7bfada16fb86785be20d)

```javascript theme={null}
const wallet = "CyaE1VxvBrahnPWkqm5VsdCvyS2QmNht2UFrKJHga54o";

const res = await fetch(`https://data.solanatracker.io/v2/pnl/wallets/${wallet}/chart`, {
  headers: { "x-api-key": "YOUR_API_KEY" }
});
const { points, summary } = await res.json();

// points is an array of daily chart rows
// summary contains streaks, drawdown, and win-rate style aggregates
console.log(points.length, summary.winRate);
```

Use `time_from` and `time_to` (Unix seconds) to page through older data.

## Performance

The [performance endpoint](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-performance.md) summarizes activity over the requested window:

![Wallet performance panel showing best day, worst day, streaks, and drawdown](https://mintcdn.com/solanatracker/ZM5vWoSAJUJFeh6A/images/guides/pnl-performance.png?fit=max\&auto=format\&n=ZM5vWoSAJUJFeh6A\&q=85\&s=7c9b39de2ea2c7c6e4cd5436251cbcfc)

| Metric | Description |
| - | - |
| Total realized PnL | Sum of realized PnL in the window |
| Total trades | Sum of daily buy/sell activity within the window (`day_buys + day_sells`), not lifetime cumulative counts |
| Win/Loss streaks | Current and maximum consecutive winning/losing days |
| Maximum drawdown | Largest drop from the highest value to the lowest dip |
| Best/Worst days | The single best and worst trading days |
| Daily breakdown | Day-by-day PnL, volume, and trade counts |

```bash theme={null}
# Last 90 days performance
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/performance?days=90" \
  -H "x-api-key: YOUR_API_KEY"
```

## Highlights

The [highlights endpoint](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-highlights.md) returns a wallet's most notable positions:

![PnL highlights panel showing biggest winner, loser, bag, and fastest flip](https://mintcdn.com/solanatracker/ZM5vWoSAJUJFeh6A/images/guides/pnl-highlights.png?fit=max\&auto=format\&n=ZM5vWoSAJUJFeh6A\&q=85\&s=b2ffc5854ac6d0ebb5e8aadfef3d7772)

> [card] Biggest Winner
>
> The position with the highest realized PnL

> [card] Biggest Loser
>
> The position with the worst realized loss

> [card] Fastest Flip
>
> Shortest hold time with a profit

> [card] Longest Hold
>
> The position held for the most time

> [card] Largest Bag
>
> Current holding with the highest USD value

> [card] Most Traded
>
> The token with the most buy/sell transactions

```bash theme={null}
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/highlights" \
  -H "x-api-key: YOUR_API_KEY"
```

## Risk

The [risk endpoint](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-risk.md) evaluates current portfolio exposure:

![Wallet exposure panel showing open positions, cost basis, current value, and PnL mix](https://mintcdn.com/solanatracker/ZM5vWoSAJUJFeh6A/images/guides/pnl-exposure.png?fit=max\&auto=format\&n=ZM5vWoSAJUJFeh6A\&q=85\&s=921b7de365bb379afcdecd660f80c235)

* **Portfolio concentration** — how much is in the top 1 and top 5 positions
* **Realized vs unrealized split** — is the wallet sitting on paper gains or locked-in profits?
* **Open position value** — total USD value of current holdings
* **Risky holdings** — list of tokens with low liquidity or high concentration risk

```bash theme={null}
curl "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/risk" \
  -H "x-api-key: YOUR_API_KEY"
```

> [!WARNING]
>
> Risk only covers **current holdings**. Sold positions aren't included.

## Live updates

Keep a wallet in sync with the Datastream PnL V2 rooms instead of polling:

* `pnl:{wallet}:summary` — total wallet PnL summary with realized/unrealized PnL, ROI, counts, averages, and open-position totals.
* `pnl:{wallet}` — every token the wallet touches, `tradeUpdate` / `balanceUpdate`.
* `pnl:{wallet}:{token}` — a single position.

Seed your UI with `GET /v2/pnl/wallets/:wallet`, then subscribe to the summary room. See the [Datastream PnL guide](https://docs.solanatracker.io/guides/datastream-pnl.md) for the full event payloads.

> [card] [Token traders](https://docs.solanatracker.io/guides/pnl-v2/token-intelligence.md)
>
> See how a specific token was traded across wallets.

> [card] [API Reference](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-summary.md)
>
> Full schema details for the wallet summary response.


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