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

# Query Solana Token Traders and First Buyers

> Query traders and first buyers for a Solana token. Compare token PnL, wallet PnL, current holdings, trade timing, and identity labels.

Use token traders to rank or filter wallets that traded a mint. Use first buyers when order matters: that endpoint returns the earliest trades first. Both expose positions, PnL, and wallet identity.

## Token traders

The [token traders endpoint](https://docs.solanatracker.io/data-api/pnl-v2/token/get-token-traders.md) returns paginated trader rows with current positions and PnL.

```bash cURL theme={null}
curl "https://data.solanatracker.io/v2/pnl/tokens/{token}/traders?sort=pnl&direction=desc&limit=20" \
  -H "x-api-key: YOUR_API_KEY"
```

```javascript JavaScript theme={null}
const token = "38PgzpJYu2HkiYvV8qePFakB8tuobPdGm2FFEn7Dpump";

const res = await fetch(
  `https://data.solanatracker.io/v2/pnl/tokens/${token}/traders?sort=pnl&direction=desc&limit=20`,
  { headers: { "x-api-key": "YOUR_API_KEY" } }
);
const { traders } = await res.json();

traders.forEach(t => {
  // pnl.token = this token's PnL, pnl.wallet = the wallet's lifetime PnL across all tokens
  console.log(`${t.wallet}: $${t.pnl.token.total.toFixed(2)} on this token, lifetime $${t.pnl.wallet?.total?.toFixed(2) ?? "n/a"}`);
});
```

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

token = "38PgzpJYu2HkiYvV8qePFakB8tuobPdGm2FFEn7Dpump"
res = requests.get(
    f"https://data.solanatracker.io/v2/pnl/tokens/{token}/traders",
    params={"sort": "pnl", "direction": "desc", "limit": 20},
    headers={"x-api-key": "YOUR_API_KEY"}
)

for t in res.json()["traders"]:
    print(f"{t['wallet']}: ${t['pnl']['token']['total']:.2f} on this token, {t['counts']['total']} trades")
```

### Sorting options

| Sort Field | Description |
| - | - |
| `pnl` | Total PnL |
| `realized` | Realized PnL only |
| `unrealized` | Unrealized PnL only |
| `invested` | Total USD invested |
| `roi` | Return on investment percentage |
| `holding` | Current token balance |
| `value` | Current USD value of the remaining position |
| `first_trade` | Time of first trade |
| `last_trade` | Time of most recent trade |

### Filtering options

| Parameter | Description |
| - | - |
| `activeOnly` | Only show wallets currently holding the token |
| `minTrades` | Minimum number of trades |
| `excludeArbitrage` | Exclude wallets flagged as arbitrage bots. **Default: `true`** — arbitrage PnL is noisy and the goal is tracking real traders. Pass `false` to include them. |
| `excludeZeroBuys` | Exclude wallets that received tokens without buying (airdrops, transfers). **Default: `true`.** |
| `platform` | Filter by trading platform (`axiom`, `bloom`, `photon`). Comma-separated for multiple. `axiom-flash` is accepted as an `axiom` alias. |

> [!WARNING]
>
> **Getting an empty `traders` array on a high-volume token?** The defaults above are filters, not safety rails — `excludeArbitrage=true`, `excludeZeroBuys=true`, and (if you set it) `activeOnly=true` are all applied before the response is built. On bot-heavy tokens this can hide every wallet. Re-run with `excludeArbitrage=false&excludeZeroBuys=false`, drop `activeOnly`, and lower `minTrades` to confirm whether the dataset itself is empty (`pagination.total: 0`) or just filtered down to zero.

> [!NOTE]
>
> This endpoint does not accept `pnlMode`. The wallet-level PnL it returns (`pnl.wallet`) reflects the API's wallet-summary view.

### Response shape: pnl.token vs pnl.wallet

Each trader carries **two** PnL objects:

* `pnl.token` — realized / unrealized / total for this exact token only.
* `pnl.wallet` — lifetime realized / unrealized / total across every token the wallet has traded.

Compare the two objects to separate performance on this mint from the wallet's wider trading history.

| Question | Field to use |
| - | - |
| Did this wallet profit on this token? | `pnl.token` |
| Is this wallet profitable overall? | `pnl.wallet` |
| Is the wallet still holding this token? | `position.balance` |
| When did the wallet first buy? | `timing.firstTrade` |

### Inline identity

Each trader in the response includes a structured `identity` object. On token endpoints this is resolved against the token in the URL, so `pool` and `developer` tags automatically reflect the right token:

```json theme={null}
"identity": {
  "tags": ["kol", "developer"],
  "kol": { "name": "Ansem", "twitter": "blknoiz06" },
  "developer": { "via": "creator", "creationTx": "5x7Y...", "createdAt": 1713600000000 }
}
```

Use the returned tags to label or filter trader rows. A primary `.sol` domain appears in `identity.sns.domain` when available; see [SNS wallet names](https://docs.solanatracker.io/guides/pnl-v2/sns-identity.md).

> [card] Filter trader rows
>
> Combine `minTrades`, `activeOnly`, and `excludeArbitrage` to set an activity threshold, require open positions, or exclude labeled arbitrage wallets.

> [card] [Wallet PnL](https://docs.solanatracker.io/guides/pnl-v2/wallet-analysis.md)
>
> Use a trader's wallet address to inspect its other positions and returns.

## First buyers

The [first-buyers endpoint](https://docs.solanatracker.io/data-api/pnl-v2/token/get-token-first-buyers.md) returns trader data in chronological order: `sort=first_trade` and `direction=asc`.

> [!WARNING]
>
> `first-buyers` rejects leaderboard-style sorting. For ROI, PnL, position size, latest trade, or descending order, use [`/v2/pnl/tokens/:token/traders`](https://docs.solanatracker.io/data-api/pnl-v2/token/get-token-traders).

```bash theme={null}
curl "https://data.solanatracker.io/v2/pnl/tokens/{token}/first-buyers?limit=50" \
  -H "x-api-key: YOUR_API_KEY"
```

> [!TIP]
>
> Use the [wallet summary](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-summary.md) to inspect a first buyer's wider trading history and available identity labels.

### Example: first buyers who closed a position

```javascript theme={null}
const token = "38PgzpJYu2HkiYvV8qePFakB8tuobPdGm2FFEn7Dpump";

const res = await fetch(
  `https://data.solanatracker.io/v2/pnl/tokens/${token}/first-buyers?limit=50`,
  { headers: { "x-api-key": "YOUR_API_KEY" } }
);
const { traders } = await res.json();

// Early buyers who are fully out of the position
const closedPositions = traders.filter(t =>
  t.position.balance === 0 && t.pnl.token.realized > 0
);

console.log(`${closedPositions.length} early buyers already sold at a profit`);
closedPositions.forEach(t => {
  const holdMins = (t.timing.lastTrade - t.timing.firstTrade) / 60000;
  console.log(`  ${t.wallet}: +$${t.pnl.token.realized.toFixed(2)}, held ${holdMins.toFixed(0)} minutes`);
});
```

> [!TIP]
>
> Compare `pnl.token` with `pnl.wallet` before ranking a trader by results on a single mint.

> [card] [Wallet PnL](https://docs.solanatracker.io/guides/pnl-v2/wallet-analysis.md)
>
> Drill into a single wallet's full PnL, positions, and risk profile.

> [card] [Snipers and bundlers](https://docs.solanatracker.io/guides/sniper-detection.md)
>
> More tools for finding early buyers, bundlers, and suspicious activity.


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