> ## 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 代币、谁仍在持有、谁最早入场——通过 PnL V2 呈现头部交易者、首批买家以及当前持仓分布。

## 代币交易者

[代币交易者](/cn/data-api/pnl-v2/get-token-traders)端点返回交易过指定代币的每个钱包,带有其当前持仓和 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>

### 排序选项

| 排序字段          | 描述          |
| ------------- | ----------- |
| `pnl`         | 总 PnL       |
| `realized`    | 仅已实现 PnL    |
| `unrealized`  | 仅未实现 PnL    |
| `invested`    | 投入的总美元金额    |
| `roi`         | 投资回报率百分比    |
| `holding`     | 当前代币余额      |
| `value`       | 剩余持仓的当前美元价值 |
| `first_trade` | 首次交易时间      |
| `last_trade`  | 最近交易时间      |

### 过滤选项

| 参数                 | 描述                                                                       |
| ------------------ | ------------------------------------------------------------------------ |
| `activeOnly`       | 仅显示当前持有该代币的钱包                                                            |
| `minTrades`        | 最少交易次数                                                                   |
| `excludeArbitrage` | 排除被标记为套利机器人的钱包。**默认: `true`** — 套利 PnL 噪声大,目标是追踪真实交易者。传入 `false` 以包含它们。  |
| `excludeZeroBuys`  | 排除未购买而获得代币的钱包(空投、转账)。**默认: `true`。**                                     |
| `platform`         | 按交易平台过滤(`axiom`、`bloom`、`photon`)。逗号分隔多个。`axiom-flash` 作为 `axiom` 别名被接受。 |

<Note>
  此端点不接受 `pnlMode`。它返回的钱包级 PnL(`pnl.wallet`)反映 API 的钱包摘要视图。
</Note>

### 响应结构:pnl.token vs pnl.wallet

每个交易者携带**两个** PnL 对象:

* `pnl.token` — 仅此代币的已实现 / 未实现 / 总 PnL。
* `pnl.wallet` — 钱包交易过的每个代币的终身已实现 / 未实现 / 总 PnL。

这让您可以在一次查询中发现在此代币上盈利但整体亏损的交易者(反之亦然),而无需第二次请求。

| 问题            | 使用的字段               |
| ------------- | ------------------- |
| 此钱包在该代币上是否盈利? | `pnl.token`         |
| 此钱包整体上是否盈利?   | `pnl.wallet`        |
| 钱包是否仍持有该代币?   | `position.balance`  |
| 钱包何时首次买入?     | `timing.firstTrade` |

### 内联身份

响应中的每个交易者都包含结构化的 `identity` 对象。在代币端点上,这会针对 URL 中的代币解析,因此 `pool` 和 `developer` 标签会自动反映正确的代币:

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

使用这个可以在无需第二次请求的情况下过滤狙击者、发现代币开发者购买自己的上线代币,或浮现 KOL 活动。

<CardGroup cols={2}>
  <Card title="按质量过滤">
    组合 `minTrades`、`activeOnly` 和 `excludeArbitrage` 以移除机器人和噪音。
  </Card>

  <Card title="交叉检查钱包" href="/cn/guides/pnl-v2/wallet-analysis">
    找到有趣的交易者?通过钱包分析指南检查他们的钱包。
  </Card>
</CardGroup>

***

## 首批买家

[首批买家](/cn/data-api/pnl-v2/get-token-first-buyers)端点返回与代币交易者相同的数据,但**仅按时间顺序排序**:最早交易优先,`sort=first_trade`、`direction=asc`。用于狙击检测和早期买家分析。

<Warning>
  `first-buyers` 拒绝排行榜风格的排序。对于 ROI、PnL、持仓规模、最近交易或降序排序,请使用 [`/v2/pnl/tokens/:token/traders`](/cn/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>
  将首批买家与[钱包摘要](/cn/data-api/pnl-v2/get-wallet-summary)交叉对比,以检查他们是真实钱包、KOL 还是一次性地址。
</Tip>

### 示例:已经卖出的狙击者

```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>
  **典型工作流:** 代币交易者 → 筛选有趣的钱包 → 首批买家以了解上线行为 → 钱包分析查看完整图景。
</Tip>

<CardGroup cols={2}>
  <Card title="钱包分析" href="/cn/guides/pnl-v2/wallet-analysis">
    深入了解单个钱包的完整 PnL、持仓和风险概况。
  </Card>

  <Card title="狙击检测" href="/cn/guides/sniper-detection">
    更多用于查找早期买家、bundler 和可疑活动的工具。
  </Card>
</CardGroup>
