Skip to main content
WSS
/
v1
/
websocket
/
ws
Messages
Charts bar update
type:object
Subscribe
type:object

Charts subscribe

Unsubscribe
type:object
Real-time price bars and market-cap bars use the same WebSocket Protocol v2 as other Snekfun services: JSON text frames, subscribe / unsubscribe envelopes, and DefaultOutgoingMessage responses. Auth: Public

Connection

  • Public URL (typical): wss://charts.snek.fun/v1/websocket/ws (reverse proxy adds /websocket before /ws).
  • Application route: the server binds WebSocket at path /ws on the charts WS port.
Open the socket, then send Connect (optional depending on client) and Subscribe messages as JSON.

Topics

TopicPurpose
LastBarOHLCV updates for a pair + interval
MCapBarMarket-cap bar updates for a pair + interval

Subscribe (client → server)

{
  "messageType": "subscribe",
  "clientId": "my-client-1",
  "requestId": "req-001",
  "topic": "LastBar",
  "data": {
    "pair": {
      "base": "279c909f348e533da5808898f87f9a14bb2c3dfbbacccd631d927a3f.534e454b",
      "quote": "."
    },
    "interval": "min1"
  }
}
  • pair.base / pair.quote: Cardano asset ids; ADA may be ".", "ADA", or "0x" on input.
  • interval: min1 | min5 | hour1 | day1 | week1 | month1.
For MCapBar, set "topic": "MCapBar" with the same data shape.

Unsubscribe

{
  "messageType": "unsubscribe",
  "clientId": "my-client-1",
  "requestId": "req-001"
}

Server → client

Envelope:
{
  "requestId": "req-001",
  "event": "LastBarUpdate",
  "messageType": "Response",
  "data": {
    "pair": "baseAsset_quoteAsset",
    "time": 1729459260,
    "low": "0.0998",
    "high": "0.1015",
    "open": "0.1001",
    "close": "0.1009",
    "volume": "345.67",
    "isRelevant": true
  }
}
MCapBarUpdate events carry mCap instead of OHLCV fields.

HTTP fallback

Use Charts HTTP for historical ranges and initial snapshots if WebSocket is unavailable.