---
title: "Reference Prices"
url: https://docs.truemarkets.co/api/websocket/market-data/reference-prices
description: "Batch of weighted reference prices computed from multiple exchange BBOs."
---

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

# Reference Prices

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

### referencePrices

Batch of weighted reference prices.

Payload: `ReferencePricesPayload`

Example payload:

```json
{
  "type": "reference_prices",
  "timestamp": 0,
  "topics": [
    "all"
  ],
  "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 ReferencePricesMessage = ReferencePricesPayload;

export interface ReferencePricesPayload {
  type: "reference_prices";
  timestamp: number;

  /** The concrete topic this message belongs to, e.g. `["reference_prices"]` — even for `all` subscribers. */
  topics: Topic[];
  data: ReferencePrice[];
}

/**
 * Topic identifier. `all` is a wildcard alias for every stream (per-instrument
 * topics excluded). Per-instrument topics are parameterized:
 * `orderbook.{venue}.{pair}` (e.g. `orderbook.hyperliquid-perp.BTC-USD`),
 * `price.{SYMBOL}` (e.g. `price.BTC`, `price.BTC-PERP`),
 * `candles.{SYMBOL}.{interval}` (e.g. `candles.ETH.1h`) and
 * `reference.{SYMBOL}` (e.g. `reference.BTC`). They are subscribable but not
 * part of the fixed enum below and are never delivered to `all` subscribers.
 *
 */
export type Topic =
  | "all"
  | "price_candles"
  | "trending_assets"
  | "surging_assets"
  | "reference_prices";

/** 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;
}
```