Skip to main content
WSS
/
websocket
/
ws
Messages
Server message
type:object
Subscribe
type:object

Protocol v2 subscribe

Unsubscribe
type:object
Connect
type:object
Ping
type:object
The snekfun-api-provider WebSocket uses Protocol v2: JSON text frames, explicit subscribe / unsubscribe envelopes (messageType, clientId, requestId, topic, optional data), plus connect / ping / pong for lifecycle. Auth: Public for most topics. Restricted flows (e.g. per-address history) may require appropriate subscription data — follow product security guidance.

Connection

  • Typical public URL: wss://analytics.snek.fun/websocket/ws
  • Application path: GET /ws on the WebSocket server port.
After connecting, send subscription messages. Outgoing frames wrap payloads in DefaultOutgoingMessage with event, messageType, and optional data (JSON mirrors server code: MainPage, PoolsFeed, KOTH, LiveOrdersFeed, UserHistoryByAddress, UserHistoryByAddressAndAsset).

Topics (subscribe topic field)

topicdataPurpose
LatestomitMain page — latest-updated pools
NewomitMain page — newest listings
MCapDescomitMain page — market cap descending
CompletedCreateOnomitCompleted pools by creation time
CompletedMCapomitCompleted pools by market cap
KOTHomitKing of the Hill updates
PoolFeedrequiredSingle pool: { "asset": "{policy}.{hex}", "pkhFilter": null | ["…"] }
LiveOrdersFeedrequiredOrders table: { "asset": "…", "pkhFilter": null | ["…"] }
UserHistoryByAddressrequired{ "address": "addr1…" }
UserHistoryByAddressAndAssetrequired{ "address": "addr1…", "asset": "policy.hex" }
PoolFeed data type is FeedByAssetData; live orders use the same shape.

Subscribe example

{
  "messageType": "subscribe",
  "clientId": "app-1",
  "requestId": "sub-pool",
  "topic": "PoolFeed",
  "data": {
    "asset": "fbd4d3c334063ac19566f6ba39b6ec707ea91fa81d0c09201575c10b.44415645",
    "pkhFilter": null
  }
}

Unsubscribe

{
  "messageType": "unsubscribe",
  "clientId": "app-1",
  "requestId": "sub-pool"
}

Connect / heartbeat

Use connect (messageType: connect) with clientId and requestId, and ping / pong (messageType: ping | pong) per the shared protocol implementation.

HTTP first

Fetch the matching initial state over HTTP (main page, pools feed, orders feed, or user history), then subscribe — see Main page, Pools feed, Orders feed, User history.