---
title: "Depth"
url: https://docs.truemarkets.co/api/websocket/institutional/depth
description: "Message sent from server containing the latest market data change for a subscribed instrument."
---

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

# Depth

True Markets CeFi WebSocket sends these messages to you.

Address: `/v1/cefi/market`

## Servers

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

## Messages

### depth

Payload: `DepthPayload`

Example payload:

```json
{
  "seqnum": "string",
  "channel": "DEPTH",
  "update": "SNAPSHOT",
  "data": {
    "symbol": "string",
    "bids": [
      {
        "price": "string",
        "qty": "string",
        "depth": "string"
      }
    ],
    "asks": [
      {
        "price": "string",
        "qty": "string",
        "depth": "string"
      }
    ]
  }
}
```

## Types

```ts
export type DepthMessage = DepthPayload;

export type DepthPayload =
  | {
  /** Current sequence number of the channel. */
  seqnum: string;
  channel: "DEPTH";
  update: "SNAPSHOT" | "UPDATE";
  data: {
    /** Human readable representation of the instrument. */
    symbol?: string;
    bids?: MarketLevel[];
    asks?: MarketLevel[];
  };
}
  | {
  /** Current sequence number of the channel. */
  seqnum: string;
  channel: "DEPTH";
  update: "SNAPSHOT_COMPLETE";

  /** The subscribed item whose snapshot is complete. */
  item: string;
};

export interface MarketLevel {
  /** Price at this level. */
  price?: string;

  /** Aggregate quantity resting at this level. */
  qty?: string;

  /** Number of orders resting at this level. */
  depth?: string;
}
```