Coin Metrics Timeseries stream API

WebSocket endpoints for getting a real-time stream of metrics, market data, indexes and other time series data.

Operations 11

GET /timeseries-stream/asset-metrics Asset metrics #
GET /timeseries-stream/market-trades Market trades #
GET /timeseries-stream/market-liquidations Market liquidations #
GET /timeseries-stream/market-openinterest Market open interest #
GET /timeseries-stream/market-contract-prices Market contract prices #
GET /timeseries-stream/market-orderbooks Market orderbooks #
GET /timeseries-stream/market-quotes Market quotes #
GET /timeseries-stream/asset-quotes Asset quotes #
GET /timeseries-stream/pair-quotes Pair quotes #
GET /timeseries-stream/market-candles Market candles #
GET /timeseries-stream/index-levels Index levels #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/coin-metrics-timeseries-stream-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

coin-metrics-timeseries-stream-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Coin Metrics API v4 Blockchain Explorer Job Timeseries stream API
  description: '[Coin Metrics Homepage](https://coinmetrics.io/)<br/> [API Backward Compatibility Policy](https://docs.coinmetrics.io/access-our-data/api#backward-compatibility)<br/> [Python API Client](https://coinmetrics.github.io/api-client-python/site/index.html)<br/><br/>

    HTTP API root endpoint URL is `https://api.coinmetrics.io/v4`. Coin Metrics&apos; paid product.<br/> WebSocket API root endpoint is `wss://api.coinmetrics.io/v4`. Coin Metrics&apos; paid product.<br/><br/> The Community HTTP API root endpoint URL is `https://community-api.coinmetrics.io/v4`. API key is not required when accessing community endpoints. Available to the community under the [Creative Commons](https://creativecommons.org/licenses/by-nc/4.0/) license.

    # Authentication

    <!-- ReDoc-Inject: <security-definitions> -->

    # Response headers

    Note that Coin Metrics API responses have a `CF-RAY` HTTP header e.g. `88a6ec1d2f930774-IAD` which can be used for diagnostic purposes. When raising Support requests, please ensure to provide the value of this header. '
  termsOfService: https://coinmetrics.io/api/terms
  contact:
    name: Coin Metrics Support
    url: https://coinmetrics.io/support/
    email: support@coinmetrics.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 4.0.0
servers:
- url: https://api.coinmetrics.io/v4
- url: wss://api.coinmetrics.io/v4
- url: https://community-api.coinmetrics.io/v4
tags:
- name: Timeseries stream
  description: WebSocket endpoints for getting a real-time stream of metrics, market data, indexes and other time series data.
paths:
  /timeseries-stream/asset-metrics:
    get:
      servers:
      - url: wss://api.coinmetrics.io/v4
      summary: Asset metrics
      description: Returns a WebSocket stream of metrics for specified assets.<br/> Endpoint supports only block by block (`1b` frequency), per second (`1s` frequency), and sub-second (`200ms` frequency) metrics.<br/> Different sets of metrics may come in different messages.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.
      operationId: getTimeseriesStreamAssetMetrics
      x-codeSamples:
      - label: JavaScript
        source: '// This is getting Reference Rates for Bitcoin and Ethereum at a frequency of 1 second

          ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/asset-metrics?assets=btc,eth&metrics=ReferenceRate&frequency=1s&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "# This is getting Reference Rates for Bitcoin and Ethereum at a frequency of 1 second\nimport asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/asset-metrics?assets=btc,eth&metrics=ReferenceRate&frequency=1s&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/AssetId'
      - $ref: '#/components/parameters/AssetMetrics'
      - $ref: '#/components/parameters/StreamAssetMetricsFrequency'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      - $ref: '#/components/parameters/IgnoreUnsupportedErrors'
      - $ref: '#/components/parameters/IgnoreForbiddenErrors'
      responses:
        '414':
          $ref: '#/components/responses/UriTooLong'
        default:
          $ref: '#/components/responses/StreamingAssetMetrics'
      security:
      - api_key: []
  /timeseries-stream/market-trades:
    get:
      servers:
      - url: wss://api.coinmetrics.io/v4
      summary: Market trades
      description: Returns a WebSocket stream of trades for specified markets.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.
      operationId: getTimeseriesStreamMarketTrades
      x-codeSamples:
      - label: JavaScript
        source: 'ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/market-trades?markets=coinbase-btc-usd-spot&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "import asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/market-trades?markets=coinbase-btc-usd-spot&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/MarketId'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      responses:
        '414':
          $ref: '#/components/responses/UriTooLong'
        default:
          $ref: '#/components/responses/StreamingMarketTrades'
      security:
      - api_key: []
  /timeseries-stream/market-liquidations:
    get:
      servers:
      - url: wss://api.coinmetrics.io/v4
      summary: Market liquidations
      description: Returns a WebSocket stream of liquidations for specified markets.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.
      operationId: getTimeseriesStreamMarketLiquidations
      x-codeSamples:
      - label: JavaScript
        source: 'ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/market-liquidations?markets=coinbase-BTCUSDT-future&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "import asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/market-liquidations?markets=coinbase-BTCUSDT-future&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/MarketId'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      responses:
        '414':
          $ref: '#/components/responses/UriTooLong'
        default:
          $ref: '#/components/responses/StreamingMarketLiquidations'
      security:
      - api_key: []
  /timeseries-stream/market-openinterest:
    get:
      servers:
      - url: wss://api.coinmetrics.io/v4
      summary: Market open interest
      description: Returns a WebSocket stream of open interests for specified markets.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.<br/><br/> <b>Note:</b> The `value_usd` field in this endpoint was previously calculated using hardcoded logic that no longer reflects current contract specifications across all exchanges.<br/><br/> To address this, we have deprecated the `value_usd` field and introduced new, more accurate metrics available via the `/timeseries/market-metrics` endpoint.<br/><br/> These two metrics should be used as a replacement for the `value_usd` field going forward:<br/> - `open_interest_reported_future_usd` to represent the notional value of open interest in U.S. dollars for futures markets<br/> - `open_interest_reported_option_notional_usd` to represent the notional value of open interest in U.S. dollars for options markets<br/><br/> We also introduced `open_interest_reported_option_market_value_usd` to represent the market value of open interest in U.S. dollars for options markets.
      operationId: getTimeseriesStreamMarketOpenInterest
      x-codeSamples:
      - label: JavaScript
        source: 'ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/market-openinterest?markets=binance-BTCUSDT-future&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "import asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/market-openinterest?markets=binance-BTCUSDT-future&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/MarketId'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '414':
          $ref: '#/components/responses/UriTooLong'
        default:
          $ref: '#/components/responses/StreamingMarketOpenInterests'
      security:
      - api_key: []
  /timeseries-stream/market-contract-prices:
    get:
      servers:
      - url: wss://api.coinmetrics.io/v4
      summary: Market contract prices
      description: Returns a WebSocket stream of contract prices for specified markets.<br/> This includes index price and mark price that are used by the exchange for settlement and risk management purposes.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.
      operationId: getTimeseriesStreamMarketContractPrices
      x-codeSamples:
      - label: JavaScript
        source: 'ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/market-contract-prices?markets=deribit-BTC-*-option&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "import asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/market-contract-prices?markets=deribit-BTC-*-option&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/MarketId'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '414':
          $ref: '#/components/responses/UriTooLong'
        default:
          $ref: '#/components/responses/StreamingMarketContractPrices'
      security:
      - api_key: []
  /timeseries-stream/market-orderbooks:
    get:
      servers:
      - url: wss://api.coinmetrics.io/v4
      summary: Market orderbooks
      description: Returns a WebSocket stream of orderbooks for specified markets.<br/> Orderbooks are delivered using a sequence of `snapshot` and `update` messages.<br/> Zero value of the `size` response field for `asks` or `bids` means negative `update`.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.
      operationId: getTimeseriesStreamMarketOrderbooks
      x-codeSamples:
      - label: JavaScript
        source: 'ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/market-orderbooks?markets=coinbase-btc-usd-spot&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "import asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/market-orderbooks?markets=coinbase-btc-usd-spot&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/MarketId'
      - $ref: '#/components/parameters/StreamingBookDepth'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      responses:
        default:
          $ref: '#/components/responses/StreamingMarketOrderbooks'
      security:
      - api_key: []
  /timeseries-stream/market-quotes:
    get:
      servers:
      - url: wss://api.coinmetrics.io/v4
      summary: Market quotes
      description: Returns a stream of quotes for specified markets.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.
      operationId: getTimeseriesStreamMarketQuotes
      x-codeSamples:
      - label: JavaScript
        source: 'ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/market-quotes?markets=coinbase-btc-usd-spot&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "import asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/market-quotes?markets=coinbase-btc-usd-spot&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/MarketId'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      - $ref: '#/components/parameters/IncludeOneSided'
      responses:
        '414':
          $ref: '#/components/responses/UriTooLong'
        default:
          $ref: '#/components/responses/StreamingMarketQuotes'
      security:
      - api_key: []
  /timeseries-stream/asset-quotes:
    get:
      servers:
      - url: wss://api.coinmetrics.io/v4
      summary: Asset quotes
      description: Returns a stream of quotes for specified assets.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.
      operationId: getTimeseriesStreamAssetQuotes
      x-codeSamples:
      - label: JavaScript
        source: 'ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/asset-quotes?assets=btc&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "import asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/asset-quotes?assets=btc&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/AssetId'
      - $ref: '#/components/parameters/AggregationMethod'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      responses:
        '414':
          $ref: '#/components/responses/UriTooLong'
        default:
          $ref: '#/components/responses/StreamingAggregatedSpreadQuotes'
      security:
      - api_key: []
  /timeseries-stream/pair-quotes:
    get:
      servers:
      - url: wss://api.coinmetrics.io/v4
      summary: Pair quotes
      description: Returns a stream of quotes for specified pairs.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.
      operationId: getTimeseriesStreamPairQuotes
      x-codeSamples:
      - label: JavaScript
        source: 'ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/pair-quotes?pairs=btc-usd&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "import asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/pair-quotes?pairs=btc-usd&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/StreamingPair'
      - $ref: '#/components/parameters/AggregationMethod'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      responses:
        '414':
          $ref: '#/components/responses/UriTooLong'
        default:
          $ref: '#/components/responses/StreamingAggregatedSpreadQuotes'
      security:
      - api_key: []
  /timeseries-stream/market-candles:
    servers:
    - url: wss://api.coinmetrics.io/v4
    get:
      summary: Market candles
      description: Returns a stream of candles for specified markets.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnection will happen.
      operationId: getTimeseriesStreamMarketCandles
      x-codeSamples:
      - label: JavaScript
        source: 'ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/market-candles?markets=bitstamp-btc-usd-spot&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "import asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/market-candles?markets=bitstamp-btc-usd-spot&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/MarketId'
      - $ref: '#/components/parameters/StreamingCandleFrequency'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      responses:
        '200':
          $ref: '#/components/responses/StreamingMarketCandles'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '414':
          $ref: '#/components/responses/UriTooLong'
      security:
      - api_key: []
  /timeseries-stream/index-levels:
    servers:
    - url: wss://api.coinmetrics.io/v4
    get:
      summary: Index levels
      description: Returns a stream of levels for specified indexes.<br/> If you are falling behind (slow client) you will get `warning` message first, then `error` message and disconnect will happen.
      operationId: getTimeseriesStreamIndexLevels
      x-codeSamples:
      - label: JavaScript
        source: '// Streams the levels for CMBIBTC index

          ws = new WebSocket("wss://api.coinmetrics.io/v4/timeseries-stream/index-levels?indexes=CMBIBTC&pretty=true&api_key=<your_key>")

          ws.onmessage = m => console.log(m.data); ws.onclose = () => console.log("closed")

          '
      - label: Python
        source: "# Streams the levels for CMBIBTC index\nimport asyncio\nimport websockets\n\nasync def handle(uri):\n    async with websockets.connect(uri) as websocket:\n        while True:\n            print(await websocket.recv())\n\nasyncio.get_event_loop().run_until_complete(handle('wss://api.coinmetrics.io/v4/timeseries-stream/index-levels?indexes=CMBIBTC&pretty=true&api_key=<your_key>'))\n"
      tags:
      - Timeseries stream
      parameters:
      - $ref: '#/components/parameters/StreamingIndexId'
      - $ref: '#/components/parameters/IncludeVerification'
      - $ref: '#/components/parameters/Backfill'
      - $ref: '#/components/parameters/Pretty'
      responses:
        '200':
          $ref: '#/components/responses/StreamingIndexLevels'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '414':
          $ref: '#/components/responses/UriTooLong'
      security:
      - api_key: []
components:
  schemas:
    TradeInitiator:
      description: Swap transaction initiator. Available for DeFi markets only.
      type: string
    StreamingMarketOpenInterest:
      description: Market open interest WebSocket message.
      properties:
        market:
          $ref: '#/components/schemas/MarketId'
        time:
          $ref: '#/components/schemas/Time'
        contract_count:
          $ref: '#/components/schemas/ContractCount'
        value_usd:
          deprecated: true
          $ref: '#/components/schemas/ContractValueUSD'
        exchange_time:
          $ref: '#/components/schemas/OpenInterestExchangeTime'
        cm_sequence_id:
          $ref: '#/components/schemas/cmSequenceId'
      required:
      - market
      - time
      - contract_count
      - value_usd
      - cm_sequence_id
      type: object
    CandleTradesCount:
      description: The number of trades used for candle calculation.
      type: string
      format: int64
    MarketQuote:
      description: Information about market quote.
      properties:
        market:
          $ref: '#/components/schemas/MarketId'
        time:
          $ref: '#/components/schemas/Time'
        coin_metrics_id:
          $ref: '#/components/schemas/OrderBookAndQuoteCoinMetricsId'
        ask_price:
          $ref: '#/components/schemas/QuoteAskPrice'
        ask_size:
          $ref: '#/components/schemas/QuoteAskSize'
        bid_price:
          $ref: '#/components/schemas/QuoteBidPrice'
        bid_size:
          $ref: '#/components/schemas/QuoteBidSize'
      type: object
      required:
      - market
      - time
      - coin_metrics_id
    StreamingMarketQuote:
      allOf:
      - $ref: '#/components/schemas/MarketQuote'
      - type: object
        properties:
          cm_sequence_id:
            $ref: '#/components/schemas/cmSequenceId'
        required:
        - cm_sequence_id
    MarketCandle:
      description: Information about market candle.
      properties:
        market:
          $ref: '#/components/schemas/MarketId'
        time:
          $ref: '#/components/schemas/Time'
        price_open:
          $ref: '#/components/schemas/CandlePriceOpen'
        price_close:
          $ref: '#/components/schemas/CandlePriceClose'
        price_high:
          $ref: '#/components/schemas/CandlePriceHigh'
        price_low:
          $ref: '#/components/schemas/CandlePriceLow'
        vwap:
          $ref: '#/components/schemas/CandleVwap'
        volume:
          $ref: '#/components/schemas/CandleVolume'
        candle_usd_volume:
          $ref: '#/components/schemas/CandleUsdVolume'
        candle_trades_count:
          $ref: '#/components/schemas/CandleTradesCount'
      type: object
      required:
      - market
      - time
      - price_open
      - price_close
      - price_high
      - price_low
      - vwap
      - volume
      - candle_usd_volume
      - candle_trades_count
    QuoteMidPrice:
      description: The average of the bid price and ask price.
      type: string
      format: decimal
    IndexLevel:
      description: Information about index level.
      properties:
        index:
          $ref: '#/components/schemas/Index'
        time:
          $ref: '#/components/schemas/Time'
        level:
          $ref: '#/components/schemas/IndexLevelValue'
        verification:
          $ref: '#/components/schemas/Verification'
      type: object
      required:
      - index
      - time
      - level
    MarketId:
      description: Unique name of the market.
      type: string
    TradeAmount:
      description: The amount of the base asset traded.
      type: string
      format: decimal
    Asset:
      description: Name of the asset.
      type: string
    CandlePriceHigh:
      description: The high price of the candle.
      type: string
      format: decimal
    QuoteBidSize:
      description: The size of the top bid on the order book. If no bids in the order book, the bid size is skipped.
      type: string
      format: decimal
    LiquidationPrice:
      description: The price of the base asset quoted in the quote asset that the liquidation was executed at.
      type: string
      format: decimal
    LiquidationAmount:
      description: The amount of the base asset liquidated.
      type: string
      format: decimal
    StreamingAssetMetric:
      description: Metric values.
      properties:
        asset:
          $ref: '#/components/schemas/Asset'
        time:
          $ref: '#/components/schemas/Time'
        cm_sequence_id:
          $ref: '#/components/schemas/cmSequenceId'
      required:
      - asset
      - time
      - cm_sequence_id
      additionalProperties:
        description: Metric value.
        type:
        - string
        - 'null'
      type: object
    CandleVwap:
      description: The volume-weighted average price of the candle.
      type: string
      format: decimal
    TradePrice:
      description: The price of the base asset quoted in the quote asset that the trade was executed at.
      type: string
      format: decimal
    CandlePriceOpen:
      description: The opening price of the candle.
      type: string
      format: decimal
    TradeImpliedVolatility:
      description: Implied volatility calculated from the trade price.
      type: string
      format: decimal
    MarkPrice:
      description: The price representing the futures' or option's price calculated by the exchange for risk management purposes.
      type: string
      format: decimal
    OrderBookType:
      description: Type of the order book.
      enum:
      - snapshot
      - update
      type: string
    StreamingMarketCandle:
      allOf:
      - $ref: '#/components/schemas/MarketCandle'
      - type: object
        properties:
          cm_sequence_id:
            $ref: '#/components/schemas/cmSequenceId'
        required:
        - cm_sequence_id
    Pair:
      description: Pair string representation as `<base>-<quote>`.
      type: string
    TradeBlockHeight:
      description: Swap block height. Available for DeFi markets only.
      type: string
      format: int64
    Index:
      description: Name of the index.
      type: string
    StreamingAggregatedSpreadQuote:
      allOf:
      - $ref: '#/components/schemas/AggregatedSpreadQuote'
      - type: object
        properties:
          cm_sequence_id:
            $ref: '#/components/schemas/cmSequenceId'
        required:
        - cm_sequence_id
    OrderBookAndQuoteCoinMetricsId:
      description: ID of an order book or quote. It can be generated by Coin Metrics or provided by an exchange. If it is generated by Coin Metrics it is unique. If it is generated by exchange we can't guarantee its uniqueness.
      type: string
    Verification:
      description: Information about verification.
      properties:
        timestamp:
          $ref: '#/components/schemas/VerificationTime'
        level:
          $ref: '#/components/schemas/VerificationIndexLevelValue'
        signature:
          $ref: '#/components/schemas/Signature'
      type: object
      required:
      - signature
    OrderBookSize:
      description: The size of the limit order on the order book in units of the base asset.
      type: string
      format: decimal
    QuoteBidPrice:
      description: The limit price of the top bid on the order book. If no bids in the order book, the bid price is skipped.
      type: string
      format: decimal
    StreamingMarketTrade:
      description: Market trade WebSocket message.
      properties:
        market:
          $ref: '#/components/schemas/MarketId'
        time:
          $ref: '#/components/schemas/Time'
        coin_metrics_id:
          $ref: '#/components/schemas/TradesCoinMetricsId'
        amount:
          $ref: '#/components/schemas/TradeAmount'
        price:
          $ref: '#/components/schemas/TradePrice'
        side:
          $ref: '#/components/schemas/TradeSide'
        cm_sequence_id:
          $ref: '#/components/schemas/cmSequenceId'
        collect_time:
          $ref: '#/components/schemas/TradeCollectTime'
        block_hash:
          $ref: '#/components/schemas/TradeBlockHash'
        block_height:
          $ref: '#/components/schemas/TradeBlockHeight'
        txid:
          $ref: '#/components/schemas/TradeTransactionId'
        initiator:
          $ref: '#/components/schemas/TradeInitiator'
        sender:
          $ref: '#/components/schemas/TradeSender'
        beneficiary:
          $ref: '#/components/schemas/TradeBeneficiary'
        mark_price:
          $ref: '#/components/schemas/TradeMarkPrice'
        index_price:
          $ref: '#/components/schemas/TradeIndexPrice'
        iv_trade:
          $ref: '#/components/schemas/TradeImpliedVolatility'
        liquidation:
          $ref: '#/components/schemas/TradeLiquidation'
      required:
      - market
      - time
      - coin_metrics_id
      - amount
      - price
      - collect_time
      - cm_sequence_id
      type: object
    TradeCollectTime:
      description: Time of when the trade was received from the exchange.
      type: string
      format: date-time
    OrderBookAsks:
      description: The ask orders on the order book.
      items:
        $ref: '#/components/schemas/BookEntry'
      type: array
    ContractCount:
      description: Number of contracts.
      type: string
      format: int64
    TradeIndexPrice:
      description: The price index is an aggregate price derived from the major exchanges to be representative of the underlying asset's market consensus price.
      type: string
      format: decimal
    OrderBookBids:
      description: The bids orders on the order book.
      items:
        $ref: '#/components/schemas/BookEntry'
      type: array
    CandleUsdVolume:
      description: The volume of the candle in USD.
      type: string
      format: decimal
    TradeTransactionId:
      description: Swap transaction ID. Available for DeFi markets only.
      type: string
    CandleVolume:
      description: The volume of the candle in units of the base asset.
      type: string
      format: decimal
    AggregatedSpreadQuote:
      description: Information about aggregated spread quote.
      properties:
        pair:
          $ref: '#/components/schemas/Pair'
        time:
          $ref: '#/components/schemas/Time'
        ask_price:
          $ref: '#/components/schemas/QuoteAskPrice'
        ask_size:
          $ref: '#/components/schemas/QuoteAskSize'
        bid_price:
          $ref: '#/components/schemas/QuoteBidPrice'
        bid_size:
          $ref: '#/components/schemas/QuoteBidSize'
        mid_price:
          $ref: '#/components/schemas/QuoteMidPrice'
        spread:
          $ref: '#/components/schemas/QuoteSpread'
      type: object
      required:
      - pair
      - time
    BookEntry:
      properties:
        price:
          $ref: '#/components/schemas/OrderBookPrice'
        size:
          $ref: '#/components/schemas/OrderBookSize'
      required:
      - price
      - size
      type: object
    QuoteAskPrice:
      description: The limit price of the top ask on the order book. If no asks in the order book, the ask price is skipped.
      type: string
      format: decimal
    LiquidationType:
      description: The liquidation type. "trade" means that liquidation was executed, "order" means that the order was placed for the liquidation at the timestamp of the data entry but it wasn't necessarily executed yet.
      type: string
    SettlementPriceEstimated:
      description: The estimated price of the underlying asset.
      type: string
      format: de

# --- truncated at 32 KB (59 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/coin-metrics/refs/heads/main/openapi/coin-metrics-timeseries-stream-api-openapi.yml