SolanaStreaming Docs

PumpSwap API

New pools, migrations, and price changes

The SolanaStreaming WebSocket API can stream parsed PumpSwap pool creation and confirmed swap events. Subscribe to newPairSubscribe for PumpSwap pools and use pair.migration === "pumpfun" to identify pools created from Pump.fun migrations. See example code snippets for different use cases below.

Install ws with npm install ws and set YOUR_API_KEY_HERE. Each example below opens its own authenticated connection.

Subscribe to new PumpSwap pools

const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com/", {
  headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
  ws.send(JSON.stringify({
    method: "newPairSubscribe",
    params: { include: { sourceExchange: ["pumpswap"] } }
  }));
  console.log("Listening for new PumpSwap pools...");
});
ws.on("message", raw => {
  const message = JSON.parse(raw.toString());
  if (message.error) return console.error("API error:", message.error);
  if (message.params)
    console.log("New PumpSwap pool:", message.params);
});
ws.on("error", console.error);

Subscribe to Pump.fun migrations

const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com/", {
  headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
  ws.send(JSON.stringify({
    method: "newPairSubscribe",
    params: { include: { migration: ["pumpfun"] } }
  }));
  console.log("Listening for Pump.fun migrations...");
});
ws.on("message", raw => {
  const message = JSON.parse(raw.toString());
  if (message.error) return console.error("API error:", message.error);
  if (message.params)
    console.log("Pump.fun migration:", message.params);
});
ws.on("error", console.error);

Subscribe to a single PumpSwap token for price changes by mint address

const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com/", {
  headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
  ws.send(JSON.stringify({
    method: "swapSubscribe",
    params: { include: { baseTokenMint: ["TOKEN_MINT_HERE"] } }
  }));
  console.log("Listening for PumpSwap token price changes...");
});
ws.on("message", raw => {
  const message = JSON.parse(raw.toString());
  if (message.error) return console.error("API error:", message.error);
  if (message.params)
    console.log("PumpSwap token price change:", message.params);
});
ws.on("error", console.error);

Subscribe to a single PumpSwap token for price changes by pool address

const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com/", {
  headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
  ws.send(JSON.stringify({
    method: "swapSubscribe",
    params: { include: { ammAccount: ["POOL_ADDRESS_HERE"] } }
  }));
  console.log("Listening for PumpSwap pool price changes...");
});
ws.on("message", raw => {
  const message = JSON.parse(raw.toString());
  if (message.error) return console.error("API error:", message.error);
  if (message.params)
    console.log("PumpSwap pool price change:", message.params);
});
ws.on("error", console.error);

Subscribe to all PumpSwap pool price changes

const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com/", {
  headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
  ws.send(JSON.stringify({
    method: "swapSubscribe",
    params: { include: { sourceExchange: ["pumpswap"] } }
  }));
  console.log("Listening for PumpSwap price changes...");
});
ws.on("message", raw => {
  const message = JSON.parse(raw.toString());
  if (message.error) return console.error("API error:", message.error);
  if (message.params)
    console.log("PumpSwap price change:", message.params);
});
ws.on("error", console.error);

Pool swaps include quotePrice, baseAmount, quoteTokenLiquidity, and usdValue. QuotePrice is denoted in the quote token of the swap. To get the usdPrice you must convert the quoteToken to USD.

See the new-pair reference and swap reference.

PumpSwap WebSocket API FAQ

How do I find Pump.fun tokens that migrated to PumpSwap?

Subscribe to new pairs with migration: ["pumpfun"], then check that pair.sourceExchange is pumpswap. Include filters use OR matching, so both conditions must be checked in your client.

Which field contains the PumpSwap pool address?

Read pair.ammAccount from a newPairNotification. Swap notifications also include swap.ammAccount to identify the pool for a trade.