subscribe - live price
Live price / market-cap updates for one pool. The server emits token_update every time the pool's last-trade price changes. Pass one of mint or pool (mint → pool lookup happens server-side).
| Channel | Socket.IO event |
| Auth | auth.api_key in the handshake |
| Emits | token_update |
Supported DEXes
Prices stream from trades on every major Solana DEX and launchpad:
Meteora covers DAMM v2 and DBC (dynamic bonding curve); Raydium covers CPMM and AMM v4. The quote field on each update tells you which mint (WSOL or USDC) the price is denominated in.
Example
- JavaScript
- Python
import { io } from "socket.io-client";
const socket = io("https://api.pumpdata.fun", {
auth: { api_key: "pd_xxxxxxxx…" },
});
socket.on("token_update", (u) => {
console.log(`${u.pool} → ${u.price} (mcap ${u.mcap})`);
});
socket.emit("subscribe", { mint: "Gc6rNxGnoQt…pump" }, (ack) => {
console.log("subscribed:", ack); // { ok: true, pool: "...", room: "..." }
});
// later, to stop (free): socket.emit("unsubscribe", { pool: "4mBL…" });
import socketio
sio = socketio.Client()
@sio.on("token_update")
def on_update(u):
print(u["pool"], "→", u["price"], "(mcap", u["mcap"], ")")
sio.connect("https://api.pumpdata.fun", auth={"api_key": "pd_xxxxxxxx…"})
sio.emit("subscribe", {"mint": "Gc6rNxGnoQt…pump"},
callback=lambda ack: print("subscribed:", ack))
sio.wait()
# later, to stop (free): sio.emit("unsubscribe", {"pool": "4mBL…"})
Response - token_update
{
"pool": "4mBLRPUyfE7CvxmXiGJx5WA51isanbxpdbdPjFuuBzmY",
"price": 0.000000033,
"mcap": 32.62,
"quote": "So11111111111111111111111111111111111111112",
"priceUSD": 0.0000049,
"mcapUSD": 4893.0,
"time": 1779812627
}
| field | meaning |
|---|---|
price | price in the quote token per base token |
quote | the quote-side mint the price is denominated in — WSOL, USDC, or USD1 |
mcap | market cap in the quote token (price × total supply) |
priceUSD | price converted to US dollars |
mcapUSD | mcap converted to US dollars |
For USDC- and USD1-quoted pools the USD fields equal price / mcap (those quotes are already dollars). For WSOL-quoted pools they're converted using the live SOL/USD rate (the same rate streamed by subscribe_sol_price). priceUSD / mcapUSD are 0 in the brief window before the first SOL/USD tick is seen.
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" }
error | When |
|---|---|
invalid_request | Neither mint nor pool was provided. |
not_found | The mint has no active pool, or the given pool is not known to the data plane. |
unavailable | A transient backend error (the server already retried). Safe to retry - it is not a definitive "not found". |
limit_exceeded | This connection already has the maximum number of subscriptions. |
If you do not pass an ack callback, the same payload is emitted as a subscription_error event instead.
Try it
Notes
- This is the cheapest live stream - use it for "current price" cards or simple tickers.
- For full trade details (wallet, signature, amounts) use
subscribe_trades. - For candlesticks use
subscribe_ohlcv.