Oracle Prices Channel

Real-time mark and index prices, broadcast once per block. Public channel, filtered by numeric market IDs.

Subscribe

{
  "method": "subscribe",
  "params": {
    "channel": "oracle",
    "market_ids": [1, 2]
  }
}
ParameterTypeRequiredDescription
market_idsnumber[]NoFilter by market IDs. Empty = all markets

The acknowledgement echoes back the filter that was actually applied. Check it — if you expected one market and see for all markets, your parameter did not reach the server.

{
  "type": "subscribed",
  "method": "subscribe",
  "status": "success",
  "message": "Successfully subscribed to oracle for 1 market(s)",
  "channel": "oracle",
  "data": { "market_ids": [1] }
}

Message Format

Update

Sent once per block. There is no snapshot for this channel.

{
  "channel": "oracle",
  "type": "update",
  "market_id": null,
  "data": {
    "prices": {
      "1": {
        "index_price": "63124681577830349000000",
        "mark_price": "63126084821834306372811"
      }
    },
    "timestamp": 1786931315
  },
  "tx_hash": "0xac2fdb604d460c39d57a0ff7a398ab28e6c6dd8b0d6955012ae3fa41cbd04bff",
  "block_number": 19325558,
  "log_index": 0,
  "worker_timestamp": "1786931315106267297"
}

Update Message Fields

FieldTypeDescription
channelstringAlways "oracle"
typestringAlways "update"
market_idnullAlways null — one message carries every subscribed market
data.pricesobjectMap of market ID (as a string key) to its price object
data.timestampnumberServer timestamp in seconds
tx_hashstringHash of the transaction that triggered the broadcast
block_numbernumberBlockchain block number
log_indexnumberLog index within the block
worker_timestampstringServer timestamp in nanoseconds when the update was built

Price Object Fields

FieldTypeDescription
index_pricestringIndex price, wei (18 decimals)
mark_pricestringMark price, wei (18 decimals)

Both fields are optional: a market appears with only the price that is currently available.

Examples

Subscribe to all markets

{
  "method": "subscribe",
  "params": {
    "channel": "oracle"
  }
}

Subscribe to a single market

{
  "method": "subscribe",
  "params": {
    "channel": "oracle",
    "market_ids": [1]
  }
}

Unsubscribe

{
  "method": "unsubscribe",
  "params": {
    "channel": "oracle"
  }
}

Testing with wscat

# Connect
wscat -c wss://ws.rise.trade/ws

# Subscribe to all markets
{"method":"subscribe","params":{"channel":"oracle"}}

# Subscribe to BTC/USDC only (market 1)
{"method":"subscribe","params":{"channel":"oracle","market_ids":[1]}}

# Unsubscribe
{"method":"unsubscribe","params":{"channel":"oracle"}}

Notes

Price Format

Prices are integer strings in wei (18 decimals), not decimals. Divide by 1018 to get a human-readable value: "63126084821834306372811" ≈ 63,126.08 USD.

This differs from the trades channel, where prices are already decimal.

Finding a Market ID

GET /v1/markets returns every market with its market_id and config.name. Market 1 is BTC/USDC.

No Snapshot

Nothing is sent at subscription time. The first message arrives with the next block.

Unknown Markets

A market_ids entry that does not exist is still accepted with a success acknowledgement. The subscription simply never delivers an update, so verify your IDs against GET /v1/markets.

Public Channel

This channel does not require authentication. Oracle prices are public market data.