Raydium API
New pools, migrations, and price changes
Use the SolanaStreaming WebSocket API to stream supported Raydium CPMM, CLMM, and legacy V4 pool events
with sourceExchange: ["raydium"]. A token migrated
from Raydium LaunchLab is tagged with pair.migration: "raydium_launchlab" on its destination
pool event. Filter swap notifications to Raydium to follow price changes across its supported pools. 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 Raydium 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: ["raydium"] } }
}));
console.log("Listening for new Raydium 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 Raydium pool:", message.params);
});
ws.on("error", console.error);
Subscribe to Raydium LaunchLab 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: ["raydium_launchlab"] } }
}));
console.log("Listening for Raydium LaunchLab 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("Raydium LaunchLab migration:", message.params);
});
ws.on("error", console.error);
Subscribe to a single Raydium 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 Raydium 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("Raydium token price change:", message.params);
});
ws.on("error", console.error);
Subscribe to a single Raydium 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 Raydium 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("Raydium pool price change:", message.params);
});
ws.on("error", console.error);
Subscribe to all Raydium 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: ["raydium"] } }
}));
console.log("Listening for Raydium 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("Raydium price change:", message.params);
});
ws.on("error", console.error);
Inspect pair.sourceExchange and
pair.migration to classify events. A swap is one observed price-changing trade, not a
continuously calculated price series. Use its slot and block time for ordering and freshness.
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.
Raydium WebSocket API FAQ
How do I subscribe to Raydium pools and swaps?
Use newPairSubscribe and swapSubscribe with
params.include.sourceExchange: ["raydium"]. This filter covers supported Raydium CPMM,
CLMM, and V4 events.
How can I identify a LaunchLab migration?
Inspect pair.migration for raydium_launchlab on a
newPairNotification. The destination pool's exchange is reported in
pair.sourceExchange.