> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsidemax.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# WebSocket All Markets

> Subscribe to allMarkets for the oracle price, mark price, and 24-hour volume of every contract in a single frame, pushed roughly once a second.

The `allMarkets` channel pushes the current **oracle price, mark price, and 24-hour volume for every contract** in one frame, about once per second. One subscription covers the whole market — you do not need a separate [`ticker`](/websocket/ticker) subscription per contract. This is a public channel and requires no authentication.

It carries three values per contract by design. For a single contract's full statistics — price change, high, low, trade count, funding rate — use [`ticker`](/websocket/ticker).

## Subscribing

```json theme={null}
{"method": "subscribe", "subscription": {"type": "allMarkets"}}
```

This channel takes **no parameters** — there is no `asset` field.

## Push message format

```json theme={null}
{
  "msg": "AllMarkets",
  "channel": "allMarkets",
  "data": {
    "ts": 1754453600000,
    "markets": [
      {"asset": "1", "oraclePx": "1012", "markPx": "1010", "vol24h": "30000"},
      {"asset": "2", "oraclePx": "500", "markPx": "500", "vol24h": "0"}
    ]
  }
}
```

## Field reference

<ResponseField name="data.ts" type="int64">
  Generation time of the frame, in Unix milliseconds.
</ResponseField>

<ResponseField name="data.markets" type="array">
  One entry per contract that currently has a price. Each entry contains:

  * **`asset`** *(string)* — the contract ID.
  * **`oraclePx`** *(string)* — current oracle price, raw integer scaled by `priceScale`; `"0"` when no data.
  * **`markPx`** *(string)* — current mark price, raw integer scaled by `priceScale`; `"0"` when no data.
  * **`vol24h`** *(string)* — 24-hour rolling volume in base units, raw integer scaled by `qtyScale`. Measured on the same basis as `volume` in the [`ticker`](/websocket/ticker) channel.
</ResponseField>

## Consuming the stream

<Steps>
  <Step title="Key by asset">
    Index `markets` by `asset` and replace your local map from each frame. Frames are full snapshots, never deltas.
  </Step>

  <Step title="Expect every priced contract">
    Coverage is all active contracts that have a price. A contract with a price but no trades yet reports `vol24h` as `"0"` — that is not an error.
  </Step>

  <Step title="Convert raw values">
    Apply each contract's `priceScale` and `qtyScale` from [`configs`](/info/configs) before display; never hardcode a scale.
  </Step>
</Steps>

<Tip>
  Use `allMarkets` to drive a market list or ticker tape, then subscribe to [`ticker`](/websocket/ticker) only for the contract the user has open.
</Tip>
