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

# Token Intelligence

> See who traded a Solana token, who is still holding, and who got in first — surface top traders, first buyers, and current positions with PnL V2.

## Token Traders

The [token traders](/data-api/pnl-v2/get-token-traders) endpoint returns every wallet that traded a given token, with their current position and PnL.

<CodeGroup>
  ```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")
  ```
</CodeGroup>

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

<Note>
  This endpoint does not accept `pnlMode`. The wallet-level PnL it returns (`pnl.wallet`) reflects the API's wallet-summary view.
</Note>

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

This lets you spot, in one query, traders who are profitable on this token but underwater overall (and vice versa) without a second request.

| 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 this to filter snipers, spot the token dev buying their own launch, or surface KOL activity without a second request. Wallets with a primary `.sol` domain also include `sns` in `identity.tags` and `identity.sns.domain`. See [SNS Primary Domain](/guides/pnl-v2/sns-identity).

<CardGroup cols={2}>
  <Card title="Filter for quality">
    Combine `minTrades`, `activeOnly`, and `excludeArbitrage` to remove bots and noise.
  </Card>

  <Card title="Cross-check wallets" href="/guides/pnl-v2/wallet-analysis">
    Found an interesting trader? Run their wallet through the wallet analysis guide.
  </Card>
</CardGroup>

***

## First Buyers

The [first buyers](/data-api/pnl-v2/get-token-first-buyers) endpoint returns the same data as token traders but is **chronological only**: earliest trade first, `sort=first_trade`, `direction=asc`. Use it for sniper detection and early-buyer analysis.

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

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

<Tip>
  Cross-reference first buyers with the [wallet summary](/data-api/pnl-v2/get-wallet-summary) to check if they're real wallets, KOLs, or throwaway addresses.
</Tip>

### Example: Snipers Who Already Sold

```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 snipersSold = traders.filter(t => 
  t.position.balance === 0 && t.pnl.token.realized > 0
);

console.log(`${snipersSold.length} early buyers already sold at a profit`);
snipersSold.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>
  **Typical workflow:** token traders → shortlist interesting wallets → first buyers for launch behavior → wallet analysis for the full picture.
</Tip>

<CardGroup cols={2}>
  <Card title="Wallet Analysis" href="/guides/pnl-v2/wallet-analysis">
    Drill into a single wallet's full PnL, positions, and risk profile.
  </Card>

  <Card title="Sniper Detection" href="/guides/sniper-detection">
    More tools for finding early buyers, bundlers, and suspicious activity.
  </Card>
</CardGroup>
