How to stream pump.fun trades in real time over WebSocket

· 3 min read

websocketreal-timestreamswallet lists

Polling a REST endpoint every second is the wrong tool for live trading — by the time you see the trade, the candle has moved. The Raiden API pushes pump.fun events over WebSocket the moment they land on chain: swaps from wallets you care about, new token launches, graduations and whale flow — filtered server-side, so your client receives only what matters.

How it works

A stream is created over REST and describes what you want to receive (kinds) and whose activity (filters sourced from your saved wallet lists — never typed inline). It returns an opaque token; you connect to that token over WebSocket. Available kinds:

KindWhat gets pushedFilter
swapsEvery trade by the wallets in your listwallet_list_id (required)
creationsNew token launchesdev_list_id — omit for ALL new tokens
gradGraduations to PumpSwap
dev_scoreDev-reputation updates
feedWhale flow above a SOL thresholdmin_sol (lamports, default 3e9)

1 · Save a wallet list

Streams pull their wallet filters from wallet groups — named lists you manage over REST (or by clicking ★ in the Terminal):

# create a group…
curl -X POST -H "X-API-Key: $RAIDEN_KEY" -d '{"name":"Snipers"}' \
  "https://terminal.raiden.wtf/api/wallet-groups"
# → {"id": "grp_5f3a…", "name": "Snipers", …}

# …and fill it (idempotent, up to 1000 wallets per group)
curl -X POST -H "X-API-Key: $RAIDEN_KEY" \
  -d '{"wallets":["8psN…VRtf","Cb3f…g9rE"]}' \
  "https://terminal.raiden.wtf/api/wallet-groups/grp_5f3a…/wallets"

2 · Create the stream

curl -X POST -H "X-API-Key: $RAIDEN_KEY" \
  -d '{"name":"whales","kinds":["swaps","feed"],"wallet_list_id":"grp_5f3a…","min_sol":3000000000}' \
  "https://terminal.raiden.wtf/api/ws-subscriptions"

{
  "id": 3,
  "token": "sub_a1b2c3…",
  "name": "whales",
  "active": true,
  "kinds": ["swaps", "feed"],
  "wallet_list_id": "grp_5f3a…",
  "min_sol": "3000000000"
}
Limits: 3 streams per account by default (raised on request). Use the opaque token to connect — not the numeric id. Flip active with a PUT to pause a stream without deleting it.

3 · Connect and receive

Authenticate with your API key and the stream token in the query string. Each pushed event carries a typeswap, token, graduate or dev_score:

import asyncio, json, websockets

URL = "wss://terminal.raiden.wtf/ws?key=YOUR_KEY&sub=sub_a1b2c3…"

async def main():
    async with websockets.connect(URL) as ws:
        async for raw in ws:
            ev = json.loads(raw)
            if ev["type"] == "swap":
                side = "BUY " if ev["is_buy"] else "SELL"
                print(side, ev["trader"][:4], ev["mint"][:4],
                      int(ev["sol_amount"]) / 1e9, "SOL")

asyncio.run(main())

Same thing in the browser or Node:

const ws = new WebSocket("wss://terminal.raiden.wtf/ws?key=YOUR_KEY&sub=sub_a1b2c3…");
ws.onmessage = (m) => {
  const ev = JSON.parse(m.data);
  if (ev.type === "graduate") console.log("graduated:", ev.mint);
};

Patterns that work well

  • Smart-money follower: build a list of profitable wallets (see the wallet-tracking guide), stream their swaps, and mirror-review every entry in seconds.
  • Launch sniffer: creations with no dev list = every new pump.fun token, pushed at creation — enrich each mint with /tokens/{mint}/pack for an instant risk read.
  • Graduation desk: grad events tell you the moment a token migrates to PumpSwap — the classic volatility window.
  • Whale radar: feed with a high min_sol is a clean "size is moving" alarm with almost no noise.

Events arrive sub-second after the chain — the same pipeline that powers the Terminal's live feed. Full stream reference in the API docs; for the historical side of the same data, start from downloading history with Python. And if the goal is mirroring wallets rather than watching them, the copy-trading bot guide builds the full signal-to-decision loop on top of these streams.

FAQ

Frequently asked questions

How many WebSocket streams can I run?

Three per account by default, raised on request during the beta. Each stream can mix multiple kinds (swaps, creations, grad, dev_score, feed), so one connection often covers a whole strategy.

How fast do events arrive?

Sub-second after the trade lands on chain — the stream is fed by the same gRPC pipeline that powers the Terminal's live feed, with filters matched server-side before push.

Can I change a stream's filters without dropping the connection?

Update the stream with a PUT on /ws-subscriptions/{id} — it re-resolves your wallet lists. You can also flip active to pause a stream without deleting it.

Build on the same data

Private beta — free invite-only keys, full REST + WebSocket access, and the same firehose that powers the Terminal.