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

# Stream New Solana Tokens and Graduations

> Subscribe to new Solana token launches, bonding curve milestones, graduation events, and metadata changes with Datastream.

Use `latest` for new indexed tokens and pools, `graduating` for tokens near curve completion, and `graduated` for migrations. Add curve or metadata subscriptions when you need those updates.

> [!NOTE]
>
> **URL:** `wss://datastream.solanatracker.io/{apiKey}`\
> Available on Premium, Business, and Enterprise plans.

## New tokens

Subscribe to `latest` for newly indexed tokens and pools.

```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;
  console.log(`New: ${token.name} (${token.symbol})`);
  console.log(`  Mint: ${token.mint}`);
  console.log(`  Created on: ${token.createdOn}`);
  console.log(`  Pool: ${pools[0]?.poolId}`);
  console.log(`  Deployer: ${pools[0]?.deployer}`);
};
```

**Payload includes:**

* Token metadata (name, symbol, mint, image, description, socials)
* Pool details (DEX, liquidity, initial price, market cap)
* Creation info (creator wallet, creation tx, timestamp)

## Graduating tokens

Subscribe to `graduating` for tokens approaching bonding curve completion. Filter the feed by market and threshold when you need a narrower set.

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

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

  const { token, pools } = msg.data;
  const curve = pools[0]?.curvePercentage;
  console.log(`Graduating: ${token.name} — ${curve}% curve`);
  console.log(`  MC: $${pools[0]?.marketCap?.usd?.toLocaleString()}`);
};
```

### Filter by market and SOL threshold

Narrow down graduating tokens by market and minimum SOL in the curve:

```javascript theme={null}
// Only pump.fun tokens with at least 50 SOL
ws.send(JSON.stringify({ type: "join", room: "graduating:pumpfun:50" }));

// Only launchpad tokens with at least 100 SOL
ws.send(JSON.stringify({ type: "join", room: "graduating:launchpad:100" }));
```

## Graduated tokens

Subscribe to `graduated` for token migration notifications.

```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 } = msg.data;
  console.log(`Graduated: ${token.name}`);
  console.log(`  New pool: ${pools[0]?.poolId}`);
  console.log(`  Liquidity: $${pools[0]?.liquidity?.usd?.toLocaleString()}`);
};
```

## Curve percentage alerts

Subscribe to `{market}:curve:{percentage}` to get alerted when any token on a specific market hits a bonding curve milestone.

Supported markets: `pumpfun`, `launchpad`, `boop`, `meteora-curve`.

```javascript theme={null}
// Alert when pump.fun tokens hit 30% curve
ws.send(JSON.stringify({ type: "join", room: "pumpfun:curve:30" }));

// Alert at 50%
ws.send(JSON.stringify({ type: "join", room: "pumpfun:curve:50" }));

// Alert at 80%
ws.send(JSON.stringify({ type: "join", room: "pumpfun:curve:80" }));
```

Choose milestones that match the states you display, such as a watchlist threshold and a near-completion alert.

## Token metadata changes

Subscribe to `metadata:{tokenAddress}` to get notified when a token updates its metadata (name, image, socials, etc.):

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

## Example: new token scanner

Filter the incoming launch feed before adding rows to the UI:

```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;
  const pool = pools[0];
  if (!pool) return;

  // Filter: only tokens with socials and decent liquidity
  const hasSocials = token.strictSocials?.twitter || token.strictSocials?.telegram;
  const hasLiquidity = pool.liquidity?.usd > 1000;

  if (hasSocials && hasLiquidity) {
    console.log(`✓ ${token.name} (${token.symbol})`);
    console.log(`  MC: $${pool.marketCap?.usd?.toLocaleString()}`);
    console.log(`  Liq: $${pool.liquidity?.usd?.toLocaleString()}`);
    console.log(`  Twitter: ${token.strictSocials?.twitter || "—"}`);
  }
};
```

## Example: graduation pipeline

Watch tokens across their full lifecycle:

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

ws.onopen = () => {
  // Watch the full pipeline
  ws.send(JSON.stringify({ type: "join", room: "pumpfun:curve:50" }));
  ws.send(JSON.stringify({ type: "join", room: "graduating" }));
  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} — halfway through bonding curve`);
  } else if (room === "graduating") {
    console.log(`[GRADUATING] ${name} — approaching completion`);
  } else if (room === "graduated") {
    console.log(`[GRADUATED] ${name} — now on DEX`);
  }
};
```

## Room reference

| Room | What you get |
| - | - |
| `latest` | Every new token/pool created |
| `graduating` | Tokens approaching curve completion |
| `graduating:{market}:{sol}` | Filtered by market and SOL threshold |
| `graduated` | Tokens that just moved to DEX |
| `{market}:curve:{pct}` | Tokens hitting a curve percentage milestone |
| `metadata:{token}` | Metadata changes |

> [card] [Find tokens](https://docs.solanatracker.io/guides/token-discovery.md)
>
> REST endpoints for trending, volume leaders, and top performers.

> [card] [Live risk signals](https://docs.solanatracker.io/guides/datastream-safety.md)
>
> Track snipers, bundlers, insiders, and holder changes in real time.


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