All tutorials

2026-03-27

How to Stream Raydium Trades and Pool Data in Real-Time

Raydium is one of the largest DEXs on Solana with four pool types: AMM, CPMM, CLMM, and LaunchLab. The Sailfish SDK gives you real-time streaming of trades and pool initializations across all four, plus a historic API for querying past data. This guide shows how to set it up.

Raydium Pool Types

Raydium operates four distinct pool types, each serving a different purpose:

  • RaydiumAmm — The legacy constant-product AMM. Still widely used for established trading pairs.
  • RaydiumCpmm — The newer constant-product market maker. Raydium's current default for standard pools.
  • RaydiumClmm — Concentrated liquidity, similar to Uniswap v3. LPs specify price ranges for capital efficiency.
  • RaydiumLaunchpad (LaunchLab) — Token launch platform with a bonding curve that graduates to an AMM pool once the curve completes.

Stream All Raydium Trades

Use the dex_types filter to narrow the stream to Raydium pools only:

import { Sailfish, SailfishTier, Trade, TradeRaw, PoolType } from "sailfish-sdk";

const sailfish = new Sailfish({
  tier: SailfishTier.free({ apiKey: "YOUR_API_KEY" }),
  filter: {
    token_addresses: [],
    pool_addresses: [],
    dex_types: ["RaydiumAmm", "RaydiumCpmm", "RaydiumClmm", "RaydiumLaunchpad"],
  },
  callbacks: {
    onTrade: (trade: Trade) => {
      console.log(`[${trade.index.tx_hash}] ${trade.base_amount} @ ${trade.price} in pool ${trade.pool_address}`);
    },
  },
});

sailfish.swim();

The dex_types field accepts any combination of PoolType values. Pass all four to get everything Raydium, or pick specific types like ["RaydiumCpmm"] to focus on one.

Get Pool Information

Use fetchPoolInfo to get pool metadata — token pair, pool type, and routing paths. This is the equivalent of a "getAllPools" lookup for a specific pool address.

const poolInfo = await sailfish.fetchPoolInfo("POOL_ADDRESS_HERE");

console.log(`Pool type: ${poolInfo.pool_type}`);
console.log(`Base token: ${poolInfo.base_token.symbol} (${poolInfo.base_token.address})`);
console.log(`Quote token: ${poolInfo.quote_token.symbol} (${poolInfo.quote_token.address})`);
console.log(`Buy path: ${poolInfo.buy_path}`);
console.log(`Sell path: ${poolInfo.sell_path}`);

The SDK caches pool info automatically, so repeated lookups for the same address are fast and don't hit the network again.

Detect New Raydium Pools

The onPoolInit callback fires when a new pool is created on any of the filtered DEX types:

const sailfish = new Sailfish({
  tier: SailfishTier.free({ apiKey: "YOUR_API_KEY" }),
  filter: {
    token_addresses: [],
    pool_addresses: [],
    dex_types: ["RaydiumAmm", "RaydiumCpmm", "RaydiumClmm", "RaydiumLaunchpad"],
  },
  callbacks: {
    onPoolInit: (poolInit) => {
      console.log(`New Raydium pool: ${poolInit.pool_address}`);
      console.log(`Type: ${poolInit.pool_type}`);
      console.log(`Tokens: ${poolInit.token_0_mint} / ${poolInit.token_1_mint}`);
      console.log(`Tx: ${poolInit.tx.tx_hash} (slot ${poolInit.tx.slot})`);
    },
  },
});

sailfish.swim();

Track Raydium LaunchLab Graduations

LaunchLab tokens start on a bonding curve and graduate to an AMM pool once the curve completes. Use onTokenGraduate to detect these events:

callbacks: {
  onTokenGraduate: (graduation) => {
    if (graduation.pool_type === "RaydiumLaunchpad") {
      console.log(`LaunchLab graduation: ${graduation.pool_address}`);
      console.log(`Token pair: ${graduation.token_0_mint} / ${graduation.token_1_mint}`);
    }
  },
},

Query Historic Raydium Trades

The REST API lets you query past trades by pool address, token address, or block range:

import { SailfishApi, SailfishTier } from "sailfish-sdk";

const api = new SailfishApi({ tier: SailfishTier.free({ apiKey: "YOUR_API_KEY" }) });

const trades = await api.fetchTrades({
  pool_address: "RAYDIUM_POOL_ADDRESS",
  limit: 100,
});

for (const trade of trades) {
  console.log(`Slot ${trade.index.tick}: ${trade.base_amount} @ ${trade.price}`);
}

For visual exploration, use the free Historic Trade Data tool.

Use TradeRaw for Lightweight Processing

The SDK provides two trade formats. Trade includes human-readable amounts and requires a PoolInfo lookup (adds latency on the first call for each pool). TradeRaw gives raw token amounts with no PoolInfo dependency — better for high-frequency processing where you already know the token decimals.

callbacks: {
  onTradeRaw: (tradeRaw: TradeRaw) => {
    if (tradeRaw.pool_type === "RaydiumCpmm") {
      console.log(`Raw trade in ${tradeRaw.pool_address}`);
      console.log(`In: ${tradeRaw.token_amount_in} of ${tradeRaw.token_address_in}`);
      console.log(`Out: ${tradeRaw.token_amount_out} of ${tradeRaw.token_address_out}`);
    }
  },
},

Filter by Specific Token or Pool

Narrow the stream to a specific token using token_addresses, or a specific pool using pool_addresses:

const sailfish = new Sailfish({
  tier: SailfishTier.free({ apiKey: "YOUR_API_KEY" }),
  filter: {
    token_addresses: ["So11111111111111111111111111111111111111112"], // wSOL
    pool_addresses: [],
    dex_types: ["RaydiumCpmm"],
  },
  // ...
});

To change filters on a live connection without reconnecting, use updateFilter:

sailfish.updateFilter({
  token_addresses: ["NEW_TOKEN_ADDRESS"],
  pool_addresses: [],
  dex_types: ["RaydiumAmm", "RaydiumCpmm"],
});

Resources