---
title: "Market trades"
method: GET
path: "/timeseries-stream/market-trades"
tags: ["Timeseries stream"]
---

# Market trades

`GET /timeseries-stream/market-trades`

## Request

- Base URL: `wss://api.coinmetrics.io/v4`
- URL: `wss://api.coinmetrics.io/v4/timeseries-stream/market-trades`
- Auth: API key in query parameter `api_key`
- TypeScript: <https://skmtc.dev/coinmetrics/apis/coin-metrics-api-v4/docs/timeseries-stream/market-trades/get.ts> (a function with typed inputs; its response is checked against the schema)

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.

## Query parameters

- `markets` string[], required
- `backfill` 'latest' | 'none'
- `pretty` boolean

## Response `default`

Trade WebSocket message.

- StreamingMarketTrade: Market trade WebSocket message.
  - `market` string, required: Unique name of the market.
  - `time` string, required: The time in ISO 8601 date-time format. Always with nanoseconds precision.
  - `coin_metrics_id` string, required: 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.
  - `amount` string, required: The amount of the base asset traded.
  - `price` string, required: The price of the base asset quoted in the quote asset that the trade was executed at.
  - `side` string: 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.
  - `cm_sequence_id` string, required: The monotonically increasing message number, resets on disconnection.
  - `collect_time` string, required: Time of when the trade was received from the exchange.
  - `block_hash` string: Swap block hash. Available for DeFi markets only.
  - `block_height` string: Swap block height. Available for DeFi markets only.
  - `txid` string: Swap transaction ID. Available for DeFi markets only.
  - `initiator` string: Swap transaction initiator. Available for DeFi markets only.
  - `sender` string: Swap caller. Available for DeFi markets only.
  - `beneficiary` string: Swap output receiver. Available for DeFi markets only.
  - `mark_price` string: The price representing the futures' or option's price calculated by the exchange for risk management purposes.
  - `index_price` string: The price index is an aggregate price derived from the major exchanges to be representative of the underlying asset's market consensus price.
  - `iv_trade` string: Implied volatility calculated from the trade price.
  - `liquidation` string: Indicates whether the maker side, taker side, or both sides of the trade is under liquidation.

## Other responses

- `414`: Provided URI is too long. It must not be greater than 10000 symbols.

---

[API](https://skmtc.dev/coinmetrics/apis/coin-metrics-api-v4.md) - [All operations](https://skmtc.dev/coinmetrics/apis/coin-metrics-api-v4/llms.txt) - [OpenAPI document](https://skmtc.dev/coinmetrics/apis/coin-metrics-api-v4/revisions/774268c0a4fe?raw)
