pnl.memedocs

WebSocket

One connection, many topics: theses, mindshare, reasons, the trader wall and every live feed on one stream slot.

The door

builder plan and up

One WebSocket, many topics: theses and their classification, mindshare, reasons, the trader wall with its moves and minute marks, and every live feed, on one key and ONE stream slot. A Builder key's single stream is the whole live experience.

WebSocket
wss://pnl.meme/v1/ws

This is the socket to build on. Two older sockets stay served for clients built on them: /v1/fomo/ws, the single-feed theses socket (legacy), and /v1/fomo/compat/v2/ws, the FomoScan-compatible socket in that layout's frames. Both carry theses only, and each connection to them takes one of the plan's stream slots, as this one does.

Every frame either way is a schema in the FOMO Data API's OpenAPI document (WsClientFrame, WsServerFrame), and the /v1/ws path there carries each topic's params, frames, resume frame types and lowest plan. OpenAPI 3.1 JSON

Connect

  • Send the key as Authorization: Bearer on the upgrade itself. Nothing rides in the query string: a URL with one is refused, because every hop logs a URL.
  • A connection holds one of your plan's open streams, shared with every server-sent stream you hold (/v1/stream, /v1/fomo/stream, /v1/pump/stream, /v1/perps/stream). Opening it costs one request of the day; after that, one request per full page of events a topic pushes (100; pump callouts 25), the REST doors' price for the same rows.
  • A refused upgrade answers before the 101 with the shared error shape: 400 a query string, 401 no key, 403 a plan with no stream, 429 every stream your plan holds is open or the day is spent, 503 admission could not be read.
Node
import WebSocket from "ws";

const cursors = {}; // topic -> { frame type -> cursor }
const ws = new WebSocket("wss://pnl.meme/v1/ws", { headers: { Authorization: "Bearer pnl_..." } });
ws.on("open", () => ws.send(JSON.stringify({ type: "subscribe", topics: [
  { topic: "theses", params: { classify: true }, resume: cursors.theses },
  { topic: "mindshare", params: { window: "1h" } },
] })));
ws.on("message", (text) => {
  const frame = JSON.parse(text);
  if (frame.type === "subscribed") cursors[frame.topic] = { ...frame.cursors };
  else if (frame.cursor) (cursors[frame.topic] ??= {})[frame.type] = frame.cursor;
  console.log(frame.type, frame.topic, frame.data ?? frame);
});

Open streams per plan

PlanOpen streams
free0
builder1
pro5
network25
fleet100

Limits

LimitMeans
Client frames60 a minute; past it the socket closes 1008. 16 KiB each, JSON text only.
Topic subscribes60 a minute, up to 20 topics a frame; past it each extra topic is refused rate_limited.
Keep-aliveThe server pings every 15 s; a client silent for 45 s is closed 1011. Every WebSocket library answers pings itself.
Slow readerMore than 1 MiB unread closes the socket 1013 slow consumer; reconnect and resume.
Closes1001 the server is restarting (reconnect), 1008 key revoked, plan changed or quota spent, 1011 our fault (reconnect).

Try it live

builder plan and up

Your key, a topic, Connect: each frame lands as it is pushed, with how long after the store wrote it. A browser cannot put a key on a WebSocket upgrade, so the page opens the push door that serves the same topic beside the socket, on the same key check, stream slot and reader; the socket itself runs from the command under it. Opening costs one request of the day and holds one of your streams until you disconnect.

This test, as a call
curl -N "https://pnl.meme/v1/fomo/stream?kind=theses" \
  -H "Authorization: Bearer pnl_..."
Not connected
Socket subscribe
{"type":"subscribe","topics":[{"topic":"theses"}]}
Open the socket with it
npx wscat -c wss://pnl.meme/v1/ws \
  -H "Authorization: Bearer pnl_..." \
  -w 60 -x '{"type":"subscribe","topics":[{"topic":"theses"}]}'

Subscribe

One frame subscribes to one or many topics. Each topic is checked against your plan as you ask for it: a topic your plan lacks is refused by name, with the plan that has it, and the others still subscribe. Subscribing to a topic you hold replaces it; unsubscribe names the topics to drop.

client → server
// traders names trader_id values the traders.roster frame lists (pump:<account id> or fomo:<handle>)
{"type":"subscribe","topics":[
  {"topic":"theses","params":{"classify":true}},
  {"topic":"perps_trades","params":{"market":"SOL","snapshot":true}},
  {"topic":"perps_levels","params":{"market":"SOL"}},
  {"topic":"mindshare","params":{"window":"1h","scope":"fomo"}},
  {"topic":"traders","params":{"traders":["pump:8f1d…"]}},
  {"topic":"smart"}
]}

// after a disconnect: the cursors you last held
{"type":"subscribe","topics":[{"topic":"theses","params":{"classify":true},
  "resume":{"thesis":"812345","thesis.classified":"c1.1764021602000.ab12"}}]}

{"type":"unsubscribe","topics":["smart"]}

Topics

An event topic sends each event once with a cursor. A state topic sends a timestamped snapshot when you subscribe, then a replacement or a change only when the data moves.

TopicKindFramesParamsPlan
theseseventthesis · thesis.classifiedchain, token, tokens (≤50), author, user_id; classify: true puts each post's classification on its thesis frame, and a thesis.classified follows a pending one when its answer is finalbuilder
mindsharestatemindsharewindow (5m … 24h, 1h default), scope market | fomobuilder
reasonsstatereasonstokens: solana:<mint> or robinhood:<0x address>, 1 to 25builder
traderseventtraders.roster · trader.added · trader.removed · trader.move · chart.snapshot · chart.pointtraders: up to 12 trader_id values from the traders.roster frame to follow on the chart (an id the roster does not list gets no chart); chart_minutes 1 … 1440 (60)builder
pump_calloutseventpump_callout · checkpointtoken or tokens (≤50), walletbuilder
tradeseventtradechain, token, tokens, author, user_id, sidebuilder
chain_tradeseventchain_tradechain, token, wallet, sidebuilder
perps_tradeseventperps_trade · checkpointmarket (required, exact case, e.g. SOL or xyz:XYZ100), wallet, snapshot (true starts with up to 100 covered fills stored in the past 5 minutes)builder
perps_levelsstateperps_levelsmarket (required, exact case). The first frame contains every covered price band. Later revisions replace it.builder
pump_walleteventpump_tradeid (a Pump account), mint, sidebuilder
token_traderseventtoken_tradetokens: 1 to 25 Solana mints; who is buying them, namedbuilder
earlyeventsignalnone: /v1/stream's early channelbuilder
matcheventsignalnone: /v1/stream's match channelbuilder
radareventsignalnone: /v1/stream's radar channelbuilder
smarteventsignalnone: /v1/stream's smart channelpro
liveeventsignalnone: /v1/stream's live channel (moves)builder

The signal channels are /v1/stream's; the record kinds and pump callouts are the FOMO Data API's; reasons are the Reasons API's record.

Frames

Every frame is one JSON text message. type says what it is, topic which subscription it belongs to; an event frame carries cursor.

FrameMeans
perps_tradeA covered Hyperliquid wallet's execution. Buy and sell identify its side of the fill. Read the position snapshot for its exposure. The venue and storage clocks are both included.
perps_levelsReplace the previous market snapshot. Position sizes, entries and estimated liquidation levels can change between fills. Subscribe again to receive the current revision.
readyFirst, always: your plan, the topics it includes, the recovery window.
subscribedA topic is live. cursors are where each of its event types starts: keep them.
errorA topic refused, by name; the connection and the other topics stay. code: plan_required (with required_plan), unknown_topic, invalid_params, invalid_cursor, topic_unavailable, not_found, rate_limited, unavailable; invalid_message (no topic) for a frame that is not a subscribe or unsubscribe.
resyncYour cursor is past the 5-minute window (or from another server process); the topic restarts from now.
thesistheses: a FOMO post the moment it is stored, with its record_id; with classify: true its data also carries classification (classified, pending or unavailable).
thesis.classifiedtheses, classify: true: the post's classification once its answer is final, for the same record_id a thesis frame carried pending.
mindsharemindshare: the window's ranking when you subscribe, then the whole ranking again when membership, a rank or a share moves, including a call ageing out of the window.
reasonsreasons: the paid reasons record (GET /v1/reasons) for each token when you subscribe, then whenever its published reasons change.
traders.rostertraders: the eligible roster, timestamped, when you subscribe; then trader.added and trader.removed as it changes. A removed trader's moves and marks stop.
trader.movetraders: a roster trader's move, with stable trader and move ids.
chart.pointtraders: a followed trader's minute mark (chart.snapshot first). key is trader + chain + coin + minute; the same key again is a correction that replaces it. mark_at, trade_at and valuation.at are separate clocks.
pump_calloutpump_callouts: the item GET /v1/fomo/pump/callouts serves. Resume is at least once: keep one callout per callout_id.
tradetrades: an observed FOMO trade, the record GET /v1/fomo/trades serves. chain_trades sends chain_trade the same way.
pump_tradepump_wallet: a stored arrival of the account's wallets, as /v1/pump/stream sends it.
token_tradetoken_traders: a named trade on a subscribed token, FOMO's own or a ranked wallet's chain trade, with its trader's board row; a wallet nobody ranks is never sent. Keep one per source and signature.
signalearly, match, radar, smart, live: the channel's new row, exactly as /v1/stream sends it.
checkpointOn the pump callout or perps fill feed, save the cursor named by the checkpoint for your next reconnect.
server → client, one example a frame
{"type":"perps_trade","topic":"perps_trades","cursor":"<signed cursor>","data":{"event_id":"fill_001","source":"hyperliquid","dex":"native","market":"SOL","wallet":"0x1111111111111111111111111111111111111111","side":"sell","price":125,"size":2,"notional_usd":250,"tid":"123","occurred_at":"2026-12-01T00:00:00.000Z","stored_at":"2026-12-01T00:00:00.100Z"}}
{"type":"perps_levels","topic":"perps_levels","market":"SOL","as_of":"2026-12-01T00:00:00Z","data":{"version":1,"revision":"…","status":"read","bands":[…],…}}
{"type":"ready","connection_id":"9f0c…","plan":"builder","topics":["theses","mindshare","reasons","traders","pump_callouts","trades","chain_trades","perps_trades","perps_levels","pump_wallet","token_traders","early","match","radar","live"],"recovery_ms":300000}
{"type":"subscribed","topic":"theses","params":{"classify":true},"cursors":{"thesis":"812300","thesis.classified":"c1.1764021600000."},"resumed":false,"replaced":false}
{"type":"error","topic":"smart","code":"plan_required","message":"smart is not included in the builder plan. It is available from the pro plan.","required_plan":"pro"}
{"type":"resync","topic":"theses","reason":"expired","recovery_ms":300000}
{"type":"thesis","topic":"theses","cursor":"812345","data":{"record_id":"cm4…","seq":812345,"handle":"alice","token_address":"7xKX…pump","text":"…","ingested_at":"2026-11-24T10:00:00.120Z",…}}
{"type":"thesis.classified","topic":"theses","cursor":"c1.1764021602000.ab12","data":{"record_id":"cm4…","thesis_key":"…","occurred_at":"…","completed_at":"2026-11-24T10:00:02.000Z","classification":{"status":"classified","reasons":[{"kind":"narrative","said_at":"…"}],"text_basis":"full","classified_at":"2026-11-24T10:00:02.000Z"},…}}
{"type":"mindshare","topic":"mindshare","data":{"window":"1h","scope":{"name":"fomo",…},"denominator":{"unit":"caller_token_pairs","value":412,…},"as_of":"2026-11-24T10:00:00.000Z","ranking":[{"id":"solana:7xKX…pump","rank":1,"mint":"7xKX…pump","ticker":"BONK","callers":31,"share":0.0752,…}]}}
{"type":"reasons","topic":"reasons","token":"solana:7xKX…pump","data":{"token":…,"reasons":[…],"voices":…,"mood":…,"read_at":"…"}}
{"type":"trader.removed","topic":"traders","as_of":"2026-11-24T10:05:00.000Z","data":{"trader_id":"pump:8f1d…"}}
{"type":"trader.move","topic":"traders","cursor":"b1.3f9a01c2.41","data":{"trader_id":"pump:8f1d…","move_id":"a41c…","move":{"id":"a41c…","kind":"buy","token":…,"usd":250,"at":"…"}}}
{"type":"chart.point","topic":"traders","key":"pump:8f1d…:solana:7xKX…pump:1764021600000","correction":false,"data":{"key":"…","trader":{"trader_id":"pump:8f1d…",…},"token":{"mint":"7xKX…pump","chain":"solana",…},"minute":"2026-11-24T10:00:00.000Z","cap_usd":4255.87,"mark_at":"2026-11-24T10:00:58.000Z","trade_at":null,"valuation":{"usd":120.4,"at":"…"}}}
{"type":"pump_callout","topic":"pump_callouts","cursor":"p1.1764021600000.co_81…","data":{"callout_id":"co_81…","coin_mint":"7xKX…pump",…}}
{"type":"trade","topic":"trades","cursor":"912001","data":{"record_id":"…","seq":912001,"side":"buy",…}}
{"type":"pump_trade","topic":"pump_wallet","cursor":"<signed arrival cursor>","data":{"wallet":"…","signature":"…","side":"buy","observedAt":"…",…}}
{"type":"token_trade","topic":"token_traders","cursor":"t1.91234567.912001","data":{"token":"7xKX…pump","at":"…","side":"buy","usd":250,"source":"chain","signature":"…","trader_id":"cmv…","board":{"rank":4,"handle":"…",…},"fomo":null,"handle":"…"}}
{"type":"signal","topic":"early","cursor":"b1.3f9a01c2.17","data":{…}}
{"type":"checkpoint","topic":"pump_callouts","cursors":{"pump_callout":"p1.1764021660000.mark"}}

Reconnect and recover

  • After a network disconnect or server restart, use exponential backoff and randomize each reconnect delay. If a server stops abruptly while your key is at its stream limit, reconnects can return HTTP 429 until the previous lease expires, up to 60 seconds after its last renewal.
  • Keep, per topic, the cursor of the last frame of each type you received, starting from the cursors the subscribed frame names (including checkpoints on the pump callout and perps fill feeds). Reconnect and subscribe with resume: { <frame type>: <cursor> }.
  • The recovery window is 5 minutes, measured on the oldest event you missed: inside it, every missed event is replayed in order, then the topic is live. Past it the server sends resync and the topic starts again from now; refetch what you need from the REST doors.
  • The record kinds resume on their own sequence (the same id /v1/fomo/stream sends), pump callouts on their p1 id, wallet activity on its signed arrival cursor, and classification revisions on their own cursor. If a signal or trader-move board sends resync with reason unknown_cursor, discard its old b1. cursor and save the cursor from the new subscribed frame.
  • For perps_trades, save each perps_trade or checkpoint cursor. GET /v1/perps/stream?market=SOL accepts it in Last-Event-ID or cursor for the same key, market and wallet filter. After a WebSocket resync, snapshot: true gives a fresh recent window. SSE returns 410 for an expired cursor. Each 100 fills delivered on a subscription costs one further request.
  • Omit resume when resubscribing to a state topic for a fresh, timestamped snapshot. Replace all saved perps_levels bands for that market on each revision.

What a subscriber costs

Nothing upstream. Every topic reads what the server already reads once for everyone: the FOMO tail, the pump window, the channel reads behind /v1/stream and the stored reasons, rankings and marks. A read is shared only between subscribers asking the same question with the same permitted data, so a thousand sockets cost what one does.

NORMALsigned outpolling? keys