Messages
No examples found{
"messageType": "subscribe",
"clientId": "c1",
"requestId": "r1",
"topic": "LastBar",
"data": {
"pair": {
"base": "policy.hex",
"quote": "."
},
"interval": "min1"
}
}{
"messageType": "unsubscribe",
"clientId": "c1",
"requestId": "r1"
}Charts WS Server
Charts WebSocket
Protocol v2 — LastBar and MCapBar streams
WSS
/
v1
/
websocket
/
ws
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/websocketbefore/ws). - Application route: the server binds WebSocket at path
/wson the charts WS port.
Topics
| Topic | Purpose |
|---|---|
LastBar | OHLCV updates for a pair + interval |
MCapBar | Market-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.
"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.Messages
No examples found{
"messageType": "subscribe",
"clientId": "c1",
"requestId": "r1",
"topic": "LastBar",
"data": {
"pair": {
"base": "policy.hex",
"quote": "."
},
"interval": "min1"
}
}{
"messageType": "unsubscribe",
"clientId": "c1",
"requestId": "r1"
}Charts bar update
type:object
Subscribe
type:object
Charts subscribe
Unsubscribe
type:object
Was this page helpful?