For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/websocket/market-data/reference.md.

Reference

Receive
/v1/defi/market
Server

Weighted reference price for a subscribed reference.{SYMBOL} topic.

Code Sample
const socket = new WebSocket("wss://api.truemarkets.co/v1/defi/market");socket.addEventListener("message", (event) => {  console.log(event.data);});

Messages

  1. payload
type*"reference"
Value in"reference"
timestamp*integer
Formatint64
topics*array<string>

The concrete topic, e.g. ["reference.BTC"].

data*

Weighted average reference price computed from multiple exchange BBOs. A CeFi instrument whose asset no exchange BBO prices (e.g. a tokenized stock) is priced from its asset's latest 30s price candle close instead, with bid, ask and mid equal and a single source.

Example
{  "type": "reference",  "timestamp": 0,  "topics": [    "string"  ],  "data": {    "symbol": "string",    "instrument": "string",    "mid_price": "string",    "bid": "string",    "ask": "string",    "sources": [      {        "source": "string",        "bid": "string",        "ask": "string",        "mid_price": "string",        "weight_pct": "string",        "timestamp": "2019-08-24T14:15:22Z"      }    ],    "timestamp": "2019-08-24T14:15:22Z"  }}