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

# Pump.fun 与联合曲线

> 在 Pump.fun 代币的整个生命周期中追踪、分析与交易——发现上线、监控 bonding curve、跟进毕业事件并通过 PumpSwap 完成兑换。

本指南涵盖 Pump.fun 代币从上线到毕业的全过程。您将学习如何发现新上线代币、追踪联合曲线进度、检测毕业事件、兑换代币以及监控风险信号。

所有这些端点和流也适用于其他联合曲线平台(Raydium LaunchLab、Boop、Meteora DBC)。

## 生命周期概览

每个 Pump.fun 代币都经过相同的阶段。联合曲线是一种定价路径,代币在迁移至常规交易池之前,价格会随着买卖而变化。

1. **创建(Created)** — 代币在联合曲线上上线。
2. **毕业中(Graduating)** — 联合曲线从 0% 填充到 100%。
3. **已毕业(Graduated)** — 曲线完成,流动性迁移到 DEX 池。

您可以使用 REST 端点、实时 WebSocket 流或两者结合追踪每个阶段。

***

## 查找新的 Pump.fun 代币

### REST: 最新代币

```bash theme={null}
curl "https://data.solanatracker.io/tokens/latest" \
  -H "x-api-key: YOUR_API_KEY"
```

按 `pools[0].market` 过滤响应以隔离 Pump.fun 代币:

```javascript theme={null}
const headers = { "x-api-key": "YOUR_API_KEY" };

const latest = await fetch(
  "https://data.solanatracker.io/tokens/latest", { headers }
).then(r => r.json());

const pumpfun = latest.filter(t => t.pools?.[0]?.market === "pumpfun");
console.log(`${pumpfun.length} new Pump.fun tokens`);
```

### REST: 带过滤器的搜索

使用[搜索端点](/cn/data-api/token-search)按特定条件查找 Pump.fun 代币:

```bash theme={null}
# 曲线 >50%、有社交、流动性 >$1k 的 Pump.fun 代币
curl "https://data.solanatracker.io/search?launchpad=pumpfun&minCurvePercentage=50&hasSocials=true&minLiquidity=1000" \
  -H "x-api-key: YOUR_API_KEY"
```

Pump.fun 的关键搜索过滤器:

| 参数                   | 描述                                   |
| -------------------- | ------------------------------------ |
| `launchpad`          | `pumpfun`,或逗号分隔以指定多个                 |
| `market`             | `pumpfun` 表示联合曲线,`pumpfun-amm` 表示已毕业 |
| `status`             | `graduating` 或 `graduated`           |
| `minCurvePercentage` | 最低联合曲线 %(0–100)                      |
| `maxCurvePercentage` | 最高联合曲线 %(0–100)                      |
| `minGraduatedAt`     | 仅返回此时间戳(毫秒)之后毕业的代币                   |
| `maxGraduatedAt`     | 仅返回此时间戳(毫秒)之前毕业的代币                   |

### REST: 按部署者查询代币

查找特定钱包上线的所有代币:

```bash theme={null}
curl "https://data.solanatracker.io/deployer/{wallet}?launchpad=pumpfun" \
  -H "x-api-key: YOUR_API_KEY"
```

### WebSocket: 实时推送

代币创建的瞬间即流式推送:

```javascript theme={null}
const ws = new WebSocket("wss://datastream.solanatracker.io/YOUR_API_KEY");

ws.onopen = () => {
  ws.send(JSON.stringify({ type: "join", room: "latest" }));
};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.type !== "message") return;

  const { token, pools } = msg.data;
  if (pools[0]?.market !== "pumpfun") return;

  console.log(`New Pump.fun: ${token.name} (${token.symbol})`);
  console.log(`  Mint: ${token.mint}`);
  console.log(`  Deployer: ${pools[0]?.deployer}`);
};
```

***

## 追踪联合曲线进度

### REST: 毕业中的代币

获取当前在联合曲线上的所有代币:

```bash theme={null}
# 曲线 > 60%、至少 20 个持有者的代币
curl "https://data.solanatracker.io/tokens/multi/graduating?minCurve=60&minHolders=20" \
  -H "x-api-key: YOUR_API_KEY"
```

| 参数             | 描述           | 默认值 |
| -------------- | ------------ | --- |
| `limit`        | 代币数量(最大 500) | 100 |
| `minCurve`     | 最小曲线 %       | 40  |
| `maxCurve`     | 最大曲线 %       | 100 |
| `minHolders`   | 最小持有者数量      | 20  |
| `markets`      | 按市场过滤(逗号分隔)  | 全部  |
| `minLiquidity` | 最小流动性(美元)    | —   |
| `minMarketCap` | 最小市值(美元)     | —   |
| `reduceSpam`   | 过滤掉快速毕业的垃圾代币 | —   |

### WebSocket: 毕业中流

```javascript theme={null}
// 所有毕业中的代币
ws.send(JSON.stringify({ type: "join", room: "graduating" }));

// 仅曲线中至少 50 SOL 的 Pump.fun 代币
ws.send(JSON.stringify({ type: "join", room: "graduating:pumpfun:50" }));
```

### WebSocket: 曲线百分比提醒

当任何代币达到特定的联合曲线里程碑时获得通知:

```javascript theme={null}
// 30% 提醒 — 早期信号
ws.send(JSON.stringify({ type: "join", room: "pumpfun:curve:30" }));

// 50% 提醒 — 一半
ws.send(JSON.stringify({ type: "join", room: "pumpfun:curve:50" }));

// 80% 提醒 — 接近毕业
ws.send(JSON.stringify({ type: "join", room: "pumpfun:curve:80" }));
```

曲线提醒支持的市场:`pumpfun`、`launchpad`、`boop`、`meteora-curve`。

***

## 检测毕业

### REST: 近期已毕业

```bash theme={null}
curl "https://data.solanatracker.io/tokens/multi/graduated?limit=50" \
  -H "x-api-key: YOUR_API_KEY"
```

| 参数             | 描述           |
| -------------- | ------------ |
| `limit`        | 代币数量(最大 500) |
| `page`         | 分页页码         |
| `reduceSpam`   | 过滤掉快速毕业的代币   |
| `markets`      | 按市场过滤        |
| `minLiquidity` | 毕业后最小流动性     |

### WebSocket: 已毕业流

```javascript theme={null}
ws.send(JSON.stringify({ type: "join", room: "graduated" }));

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.type !== "message") return;

  const { token, pools, graduationTx, graduationTime } = msg.data;
  console.log(`Graduated: ${token.name}`);
  console.log(`  Pool: ${pools[0]?.poolId}`);
  console.log(`  Liquidity: $${pools[0]?.liquidity?.usd?.toLocaleString()}`);
  console.log(`  Tx: ${graduationTx}`);
};
```

***

## 示例:毕业管道

在 Pump.fun 完整生命周期中关注代币:

```javascript theme={null}
const ws = new WebSocket("wss://datastream.solanatracker.io/YOUR_API_KEY");

ws.onopen = () => {
  ws.send(JSON.stringify({ type: "join", room: "pumpfun:curve:50" }));
  ws.send(JSON.stringify({ type: "join", room: "graduating:pumpfun:50" }));
  ws.send(JSON.stringify({ type: "join", room: "graduated" }));
};

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.type !== "message") return;

  const room = msg.room;
  const name = msg.data?.token?.name || "Unknown";

  if (room?.includes("curve:")) {
    console.log(`[50% CURVE] ${name}`);
  } else if (room === "graduating") {
    console.log(`[GRADUATING] ${name}`);
  } else if (room === "graduated") {
    console.log(`[GRADUATED] ${name} — now on DEX`);
  }
};
```

***

## 兑换 Pump.fun 代币

使用 [Raptor Swap API](/cn/raptor/overview) 买卖 Pump.fun 代币。它会自动处理联合曲线兑换和毕业后 DEX 兑换。

```javascript theme={null}
const headers = { "Content-Type": "application/json" };

// Buy a Pump.fun token with 0.1 SOL
const response = await fetch("https://swap-v2.solanatracker.io/swap", {
  method: "POST",
  headers,
  body: JSON.stringify({
    wallet: "YOUR_WALLET_ADDRESS",
    from: "So11111111111111111111111111111111111111112",
    to: "TOKEN_MINT_ADDRESS",
    amount: 0.1,
    slippage: 15,
    priorityFee: 0.0005
  })
});

const { txn } = await response.json();
// Sign and send the transaction
```

对于毕业前的代币,Raptor 会自动通过 Pump.fun 的联合曲线进行路由;对于已毕业的代币,则通过 DEX 池路由。

请参阅完整的 [Swap API 指南](/cn/guides/swap-api),了解如何发送交易和 WebSocket 流式传输。

***

## 风险信号

Pump.fun 代币带有可监控的特定风险:

| 风险因素          | 评分   | 含义                          |
| ------------- | ---- | --------------------------- |
| Pump.fun 合约风险 | 10   | Pump.fun 合约可随时被 Pump.fun 修改 |
| 未完成的联合曲线      | 4000 | 尚无 DEX 流动性,仍在曲线上            |

使用这些 Datastream room 监控任何 Pump.fun 代币的安全信号:

| Room                  | 追踪内容        |
| --------------------- | ----------- |
| `sniper:{token}`      | 狙击钱包余额变化    |
| `bundlers:{token}`    | 打包交易的钱包     |
| `insider:{token}`     | 内部人钱包动向     |
| `dev_holding:{token}` | 创建者/部署者持仓   |
| `holders:{token}`     | 总持有者数量      |
| `top10:{token}`       | 前 10 持有者集中度 |

请参阅[安全流指南](/cn/guides/datastream-safety)以获取完整示例。

***

## Yellowstone gRPC(高级)

对于低层交易解析,使用 Yellowstone gRPC 直接从 Solana 流式传输原始 Pump.fun 交易:

* [Pump.fun 买/卖检测](/cn/yellowstone-grpc/examples/pumpfun-transactions) — 通过完整 IDL 解码解析买/卖事件
* [Pump.fun 账户流式传输](/cn/yellowstone-grpc/examples/pumpfun-accounts) — 监控联合曲线账户状态变化

***

## Room 参考

| Room                       | 您获得的内容                             |
| -------------------------- | ---------------------------------- |
| `latest`                   | 所有新代币(按 `market === "pumpfun"` 过滤) |
| `graduating`               | 接近曲线完成的所有代币                        |
| `graduating:pumpfun:{sol}` | 曲线中至少有指定 SOL 的 Pump.fun 代币         |
| `graduated`                | 所有刚迁移到 DEX 的代币                     |
| `pumpfun:curve:{pct}`      | 达到特定曲线 % 的代币                       |

## API 端点

| 端点                                                                 | 描述                          |
| ------------------------------------------------------------------ | --------------------------- |
| [GET /tokens/multi/graduating](/cn/data-api/get-graduating-tokens) | 联合曲线上的代币                    |
| [GET /tokens/multi/graduated](/cn/data-api/get-graduated-tokens)   | 近期已毕业的代币                    |
| [GET /tokens/latest](/cn/data-api/get-latest-tokens)               | 最新代币                        |
| [GET /search](/cn/data-api/token-search)                           | 使用 `launchpad=pumpfun` 过滤搜索 |
| [GET /deployer/{wallet}](/cn/data-api/get-tokens-by-deployer)      | 按部署者钱包查询代币                  |

<CardGroup cols={2}>
  <Card title="代币发现" href="/cn/guides/token-discovery">
    覆盖所有市场的热门、成交量领跑者和表现最佳代币。
  </Card>

  <Card title="代币发现流" href="/cn/guides/datastream-tokens">
    实时毕业中、已毕业和曲线百分比流。
  </Card>

  <Card title="安全流" href="/cn/guides/datastream-safety">
    狙击者、bundler、内部人和持有者监控。
  </Card>

  <Card title="Swap API" href="/cn/guides/swap-api">
    通过 Raptor 自动路由买卖代币。
  </Card>
</CardGroup>
