VORDIUM DOCS
API Reference

WebSocket

Subscribe to real-time chain events.

Real-time market and account data over a single socket.

Endpoint

Text
wss://rpc.vordium.com/ws

Subscribing

Send a JSON frame naming the channel and pair. Multiple subscriptions may share one socket.

JavaScript
const ws = new WebSocket('wss://rpc.vordium.com/ws')

ws.onopen = () => {
  ws.send(JSON.stringify({ method: 'subscribe', channel: 'orderbook', pair_id: 1 }))
  ws.send(JSON.stringify({ method: 'subscribe', channel: 'trades',    pair_id: 1 }))
}

ws.onmessage = (e) => {
  const msg = JSON.parse(e.data)
  console.log(msg.channel, msg.data)
}

Channels

ChannelPayloadNotes
orderbookBids and asks for one pairSnapshot on subscribe, deltas after
tradesExecuted fillsNewest first
oracleMark and index price updates1e6-scaled integers
positionsYour open positionsRequires an address
ordersYour resting ordersRequires an address

Reconnecting

The socket is stateless: on reconnect, re-send every subscription. A short randomised backoff (1s, 2s, 4s, capped) avoids stampeding the endpoint after a network blip.

Prices are integers

Oracle frames carry 1e6-scaled integers, matching the REST /oracle/{pair_id} endpoint. Divide by 1e6 before display.