---
title: "Reference"
url: https://docs.truemarkets.co/api/websocket/market-data/reference
description: "Weighted reference price for a subscribed reference.{SYMBOL} topic."
---

Docs index: https://docs.truemarkets.co/llms.txt

# Reference

True Markets Market Data WebSocket sends these messages to you.

Address: `/v1/defi/market`

## Servers

- `wss://api.truemarkets.co` (Production, wss)
- `wss://api.uat.truemarkets.co` (Uat, wss)

## Messages

### reference

Weighted reference price for one symbol.

Payload: `ReferencePayload`

Example payload:

```json
{
  "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"
  }
}
```

## Types

```ts
export type ReferenceMessage = ReferencePayload;

export interface ReferencePayload {
  type: "reference";
  timestamp: number;

  /** The concrete topic, e.g. `["reference.BTC"]`. */
  topics: string[];
  data: ReferencePrice;
}

/** 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. */
export interface ReferencePrice {
  symbol?: string;

  /** The True Markets CeFi instrument this price is for, from the asset's cefi exchange mapping. Absent when no CeFi instrument trades the asset. */
  instrument?: string;

  /** Weighted mid price. */
  mid_price?: string;

  /** Weighted best bid. */
  bid?: string;

  /** Weighted best ask. */
  ask?: string;

  /** Per-exchange BBOs that contributed to the weighted price. */
  sources?: SourceBBO[];

  /** RFC 3339 timestamp when the reference price was computed. */
  timestamp?: string;
}

/** Best bid and offer from a single exchange contributing to a reference price. */
export interface SourceBBO {
  /** Exchange the BBO was sourced from. */
  source?: string;
  bid?: string;
  ask?: string;
  mid_price?: string;

  /** Percentage weight applied to this source when computing the reference price. */
  weight_pct?: string;

  /** RFC 3339 timestamp when the BBO was observed. */
  timestamp?: string;
}
```