Skip to main content

subscribe_trades - live trades

Every trade executed on the pool, with full details (wallet, signature, amounts, price). Server emits trade. Pass one of mint or pool.

ChannelSocket.IO event
Authauth.api_key in the handshake
Emitstrade

Example

import { io } from "socket.io-client";

const socket = io("https://api.pumpdata.fun", {
auth: { api_key: "pd_xxxxxxxx…" },
});

socket.on("trade", (t) => {
const side = t.is_buy ? "BUY " : "SELL";
console.log(`${side} ${t.token_amount.toFixed(2)} @ ${t.price} by ${t.wallet.slice(0, 4)}`);
});

socket.emit("subscribe_trades", { pool: "4mBL…" });

// later, to stop (free): socket.emit("unsubscribe_trades", { pool: "4mBL…" });

Response - trade

{
"protocol": "PUMPSWAP",
"pool": "4mBLRPUyfE7CvxmXiGJx5WA51isanbxpdbdPjFuuBzmY",
"mint": "Gc6rNxGnoQt6vCfhNzn5iJnPBu1V38GZfdYERfnXpump",
"signature": "c9asMSPXxiEYC4RQpLBFUAASCL63TXZpPgSPgivDcJxsNoNc7ptrh6DfJy67NS2p7nEQBbVR45ZuPhyBqectR76",
"is_buy": true,
"token_amount": 153285714.285714,
"quote_amount": 5.0,
"price": 0.000000033,
"marketcap": 32.618826,
"wallet": "9AiXyDfy6cKieVPgwyfsNS37HypoS8k7ju2CV3WnyvZG",
"timestamp": 1779812627
}
  • is_buy - true if the trader received the base token (price went up); false if they sold it.
  • token_amount / quote_amount - in human units (already adjusted for decimals).

Errors

If the subscription cannot be created, the ack callback receives an error object instead of { ok: true }:

{ "error": "not_found", "message": "pool not found" }
errorWhen
invalid_requestNeither mint nor pool was provided.
not_foundThe mint has no active pool, or the given pool is not known to the data plane.
unavailableA transient backend error (the server already retried). Safe to retry - it is not a definitive "not found".

If you do not pass an ack callback, the same payload is emitted as a subscription_error event instead.

Try it

Notes

  • We only publish trades for pools with at least one live subscriber, so the firehose stays cheap. You're billed per trade message delivered (see Pricing).
  • Trade order within a pool is preserved.
  • Want just price/mcap? Use the cheaper subscribe.