Use this skill any time you're building or debugging realtime event flows in PumpKit — WebSocket subscriptions to pump.fun events, SSE fan-out to clients, decoder pipelines, reconnect-with-replay, multi-provider quorum streams. Triggers on "logsSubscribe", "programSubscribe", "accountSubscribe", "SSE", "event monitor", "websocket dropped events", "channel bot feed". Skip for one-shot reads (use [inspect-curve](../../commands/inspect-curve.md) or `getAccountInfo` directly).
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Instruções da origem · Visualização somente leitura
name
event-streaming
description
Use this skill any time you're building or debugging realtime event flows in PumpKit — WebSocket subscriptions to pump.fun events, SSE fan-out to clients, decoder pipelines, reconnect-with-replay, multi-provider quorum streams. Triggers on "logsSubscribe", "programSubscribe", "accountSubscribe", "SSE", "event monitor", "websocket dropped events", "channel bot feed". Skip for one-shot reads (use [inspect-curve](../../commands/inspect-curve.md) or `getAccountInfo` directly).
Event streaming for PumpKit
This skill is the project-specific reference for ingesting pump.fun events in realtime and reliably fanning them out to downstream consumers (channel bot, dashboard, claim tracker, analytics).
Each box has a distinct failure mode and a distinct test surface. Conflate them and you get bugs that only surface in prod.
Subscription types
Subscription
Use for
Trade-off
logsSubscribe(programId)
Every event from a program (firehose)
Highest volume; need to filter downstream
programSubscribe(programId, filters)
Account-change stream filtered server-side
Cheaper, but less flexible than logs
accountSubscribe(pda)
One account's state changes
Cleanest for tracking a single coin
signatureSubscribe(sig)
One tx's status changes
One-shot, fires on confirm/finalize/error
PumpKit's channel and event-monitor packages use logsSubscribe for the pump program (firehose) and accountSubscribe for specific curves being tracked. The recent refactor(channel): use typed V2 event decoders commits moved decode to the SDK — never hand-roll.
Resilient WebSocket pattern
WebSockets silently die. Cloudflare-fronted endpoints often kill idle sockets at 60s. Your subscriber must:
Send a heartbeat every ~20s and reconnect on missed pong.
Reconnect to a failover provider on socket close.
Replay missed events on reconnect by walking signatures since the last seen slot.
Dedupe by signature if running quorum mode across providers.
Cost: 2× the streamer RPC budget. Benefit: a single-provider outage doesn't lose events.
Observability
Track:
events.received_count{source, type} — by source provider and event type
events.decode_failures_count{source} — log lines the decoder didn't match
events.duplicate_count{source} — quorum dedup hits
ws.reconnect_count{source} and ws.uptime_seconds{source} — socket health
ws.replayed_events_count{source} — events recovered via post-reconnect replay
sse.connected_clients and sse.dropped_count
Alert on:
Decode-failure rate spike on any provider (SDK drift or new event type)
Reconnect rate > 1/min for >5min (provider degraded)
Replay backlog > 100 events (provider was down long enough to risk gaps)
Common pitfalls
Treating logsSubscribe as exactly-once. It isn't — handle duplicates by signature.
No heartbeat → silent socket death. Cloudflare-fronted endpoints will kill you.
Reconnect without replay. You'll silently miss events while reconnecting.
Hand-decoding log lines. Use the SDK. Always.
One subscriber for everything. Splitting reader/streamer/sender pools is also good practice for streamer count: don't share one provider for both channel bot and dashboard.
Unbounded seen set memory. LRU-trim or use a TTL set.