Coin Metrics Timeseries stream API

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

OpenAPI Specification

coin-metrics-timeseries-stream-api-openapi.yml Raw ↑
openapi: 3.0.2
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:
    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
    TradeAmount:
      description: The amount of the base asset traded.
      type: string
      format: decimal
    TradeInitiator:
      description: Swap transaction initiator. Available for DeFi markets only.
      type: string
    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
    TradeTransactionId:
      description: Swap transaction ID. Available for DeFi markets only.
      type: string
    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
    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
    OpenInterestExchangeTime:
      description: Time corresponding to open interest data point, according to the exchange. Can be NULL, if exchange doesn't support it.
      type: string
      format: date-time
    TradePrice:
      description: The price of the base asset quoted in the quote asset that the trade was executed at.
      type: string
      format: decimal
    QuoteAskSize:
      description: The size of the top ask on the order book. If no asks in the order book, the ask size is skipped.
      type: string
      format: decimal
    Time:
      description: The time in ISO 8601 date-time format. Always with nanoseconds precision.
      type: string
      format: date-time
    StreamingMarketCandle:
      allOf:
      - $ref: '#/components/schemas/MarketCandle'
      - type: object
        properties:
          cm_sequence_id:
            $ref: '#/components/schemas/cmSequenceId'
        required:
        - cm_sequence_id
    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:
        nullable: true
        description: Metric value.
        type: string
      type: object
    CandlePriceClose:
      description: The closing price of the candle.
      type: string
      format: decimal
    CandlePriceOpen:
      description: The opening price of the candle.
      type: string
      format: decimal
    LiquidationSide:
      description: The market order side. "buy" means that an ask was removed from the book by an incoming buy order, "sell" means that a bid was removed from the book by an incoming sell order.
      type: string
    TradeBlockHash:
      description: Swap block hash. Available for DeFi markets only.
      type: string
    BookEntry:
      properties:
        price:
          $ref: '#/components/schemas/OrderBookPrice'
        size:
          $ref: '#/components/schemas/OrderBookSize'
      required:
      - price
      - size
      type: object
    MarketId:
      description: Unique name of the market.
      type: string
    QuoteMidPrice:
      description: The average of the bid price and ask price.
      type: string
      format: decimal
    Asset:
      description: Name of the asset.
      type: string
    MarkPrice:
      description: The price representing the futures' or option's price calculated by the exchange for risk management purposes.
      type: string
      format: decimal
    ContractValueUSD:
      deprecated: true
      description: 'Deprecated. Contract value in USD. This field was previously calculated using hardcoded logic that no longer reflects current contract specifications across all exchanges. Please use the new metrics available via `/timeseries/market-metrics` endpoint: `open_interest_reported_future_usd` for futures markets and `open_interest_reported_option_notional_usd` for options markets.'
      type: string
      format: decimal
    OrderBookBids:
      description: The bids orders on the order book.
      items:
        $ref: '#/components/schemas/BookEntry'
      type: array
    cmSequenceId:
      description: The monotonically increasing message number, resets on disconnection.
      type: string
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorObject'
      required:
      - error
      type: object
    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
    LiquidationAmount:
      description: The amount of the base asset liquidated.
      type: string
      format: decimal
    TradeSide:
      description: The market order side. "buy" means that an ask was removed from the book by an incoming buy order, "sell" means that a bid was removed from the book by an incoming sell order.
      type: string
    CandlePriceLow:
      description: The low price of the candle.
      type: string
      format: decimal
    TradeLiquidation:
      description: Indicates whether the maker side, taker side, or both sides of the trade is under liquidation.
      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
    ErrorObject:
      properties:
        type:
          description: Error type string. Can be used for error identification.
          type: string
        message:
          description: Human-friendly error description. Can be amended without prior notification. Do not use for error identification in your code.
          type: string
      required:
      - type
      - description
      type: object
    QuoteSpread:
      description: The difference between the bid price and ask price as a percentage of the mid price.
      type: string
      format: decimal
    OrderBookSize:
      description: The size of the limit order on the order book in units of the base asset.
      type: string
      format: decimal
    CandleVwap:
      description: The volume-weighted average price of the candle.
      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
    TradeMarkPrice:
      description: The price representing the futures' or option's price calculated by the exchange for risk management purposes.
      type: string
      format: decimal
    StreamingMarketQuote:
      allOf:
      - $ref: '#/components/schemas/MarketQuote'
      - type: object
        properties:
          cm_sequence_id:
            $ref: '#/components/schemas/cmSequenceId'
        required:
        - cm_sequence_id
    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
    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
    TradesCoinMetricsId:
      description: ID of a trade (unique per exchange market). We are using exchange reported value if exchange reports a unique numeric trade id. If exchange reports trade id as a string we convert to numeric using Bijective mapping from exchange reported trade id's string. If exchange doesn't report unique ID we transform it using exchange reported data to form a unique value per market.
      type: string
    OrderBookAsks:
      description: The ask orders on the order book.
      items:
        $ref: '#/components/schemas/BookEntry'
      type: array
    Pair:
      description: Pair string representation as `<base>-<quote>`.
      type: string
    ContractCount:
      description: Number of contracts.
      type: string
      format: int64
    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
    OptionTickerExchangeTime:
      description: Time corresponding to option ticker data point, according to th

# --- 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