> For the complete documentation index, see [llms.txt](https://docs-cn.multimarkets.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-cn.multimarkets.org/client-api/bao-jia-jie-kou/ding-yue-jie-kou/ju-he-pan-kou-cheng-jiao-bao-jia-ding-yue.md).

# 聚合盘口成交报价订阅

## 接口说明

该接口特性为对于每一个websocket连接，每发送一次该请求，后台会默认覆盖上一次订阅请求。订阅成功后会进行推送数据。

## 请求-协议号：14024

### 数据格式:json

### 数据结构

#### data定义

| 字段           | 名称   | 类型    | 必填项 | 说明              |
| ------------ | ---- | ----- | --- | --------------- |
| symbol\_list | 产品列表 | array | 是   | 具体格式见下面symbol定义 |

#### symbol定义

| 字段                 | 名称     | 类型     | 必填项 | 说明                                                                                   |
| ------------------ | ------ | ------ | --- | ------------------------------------------------------------------------------------ |
| symbol\_id         | 产品ID   | uint64 | 是   |                                                                                      |
| trade\_type        | 交易类型   | uint32 | 是   | 1:全仓合约,2:逐仓合约,3:杠杆,5:现货,6:股票                                                         |
| trade\_mode        | 交易模式   | uint32 | 是   | 1:MM,2:蝴蝶MM,3:撮合,4:聚合                                                                |
| depth\_level       | 深度层级   | uint32 | 否   | 如果没有depth\_level字段时，后台只会提供一层的报价，请求的层级大于实际报价层级，或者如果没有depth\_level字段时，则后台按实际报价有多少层给多少层 |
| trade\_info\_count | 成交信息个数 | uint32 | 是   | 表示你这次订阅希望应答给你返回多少个成交报价信息                                                             |

### 请求示例

```json
{
    "cmd_id":14024,
    "seq_id":123,
    "ext":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
        "symbol_list": [
            {
		"symbol_id": 112312,
		"trade_type": 1,
                "trade_mode": 0,
                "depth_level": 5,
                "trade_info_count": 5,
            },
	],
    }
}
```

## 应答-协议号：14025

### 数据格式:json

### 数据结构

#### data定义

| 字段         | 名称       | 类型    | 说明            |
| ---------- | -------- | ----- | ------------- |
| tick\_list | tick快照数据 | array | 具体格式见下面tick定义 |

#### tick定义

| 字段            | 名称    | 类型     | 说明                                                          |
| ------------- | ----- | ------ | ----------------------------------------------------------- |
| symbol\_id    | 产品ID  | uint64 |                                                             |
| trade\_type   | 交易类型  | uint32 | 1:全仓合约,2:逐仓合约,3:杠杆,5:现货,6:股票                                |
| trade\_mode   | 交易模式  | uint32 | 1:MM,2:蝴蝶MM,3:撮合,4:聚合                                       |
| seq           | 报价序号  | uint64 |                                                             |
| tick\_time    | 报价时间戳 | uint64 |                                                             |
| price\_digits | 价格小数位 | uint32 |                                                             |
| bid\_deep     | bid深度 | array  | 见下面bid\_deep定义,该深度个数会因请求里的depth\_level，merge\_accuracy不同而不同 |
| ask\_deep     | ask深度 | array  | 见下面ask\_deep定义,该深度个数会因请求里的depth\_level，merge\_accuracy不同而不同 |
| trade\_info   | 成交信息  | array  | 见下面trade\_info定义                                            |

#### bid\_deep定义

| 字段          | 名称       | 类型     | 说明          |
| ----------- | -------- | ------ | ----------- |
| price\_bid  | 买一价，买盘价格 | string |             |
| volume\_bid | 买一量，买盘量  | string |             |
| detail      | 聚合明细     | array  | 见下面detail定义 |

#### ask\_deep定义

| 字段          | 名称       | 类型     | 说明          |
| ----------- | -------- | ------ | ----------- |
| price\_ask  | 卖一价，卖盘价格 | string |             |
| volume\_ask | 卖一量，卖盘量  | string |             |
| detail      | 聚合明细     | array  | 见下面detail定义 |

#### detail定义

| 字段       | 名称  | 类型     | 说明 |
| -------- | --- | ------ | -- |
| exchange | 交易所 | string |    |
| volume   | 量   | string |    |

#### trade\_info定义

| 字段               | 名称    | 类型     | 说明                 |
| ---------------- | ----- | ------ | ------------------ |
| price            | 成交价   | string |                    |
| volume           | 成交量   | string |                    |
| trade\_direction | 交易方向  | uint32 | 0为默认值，1为BUY，2为SELL |
| trade\_time      | 成交时间戳 | uint64 | 单位秒                |

### 应答示例

```json
{
    "ret":200,
    "msg":"ok",
    "cmd_id":14025,
    "seq_id":123,
    "ext":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
        "tick_list":[
            {
		"symbol_id": 123,
		"trade_type": 1,
                "trade_mode": 0,
		"seq": 1605509068000001,
		"tick_time": 1605509068,
                "price_digits": 2,
		"bid_deep": [
                    {
			"price_bid": "9.12",
                        "volume_bid": "9.12",
                        "detail": [
                            {
                                "exchange": "BA",
                                "volume": "9.12",
                            },
                        ],
                    },
		],
                "ask_deep": [
                    {
			"price_ask": "147.12",
			"volume_ask": "147.12",
                        "detail": [
                            {
                                "exchange": "BA",
                                "volume": "9.12",
                            },
                        ],
                    },
		],
                "trade_info": [
                    {
			"price": "651.12",
                        "volume": "100",
                        "trade_direction": 1,
                        "trade_time": 1605509068,
                    },
		]
            },
        ]
    }    
}
```

## 推送数据-实时成交报价推送

### 说明

该报价推送主要体现成交信息，推送数据内容为字符串，目前一次推送一条报价 请求者发送了盘口成交报价订阅请求，后台服务才会对请求者推送该数据

### 字段解释

pt(产品ID，报价交易类型，成交模式，报价序号，报价时间戳，当前价，成交量，成交方向); "pt(symbol\_id,trade\_type,trade\_mode,seq,tick\_time,price,volume,trade\_direction);" trade\_type的值含义 1:全仓合约,2:逐仓合约,3:杠杆,5:现货,6:股票 trade\_mode的值含义 1:MM,2:蝴蝶MM,3:撮合,4:聚合

### 推送数据示例

"pt(1123,1,0,1232312,34545435345,6.23,1000,1);"

## 推送数据-盘口报价推送

### 说明

该报价推送主要体现盘口信息，会按订阅请求里的合并精度字段进行深度报价的合并处理，推送数据内容为字符串，目前一次推送一条报价 请求者发送了盘口成交报价订阅请求，后台服务才会对请求者推送该数据

### 字段解释

pdd(产品ID，报价交易类型，成交模式，报价序号，报价时间戳);(第1档bid价，第1档bid量{交易所1,量1}{交易所2,量2})(第2档bid价，第2档bid量{交易所1,量1}{交易所2,量2});(第1档ask价，第1档ask量{交易所1,量1}{交易所2,量2})(第2档ask价，第2档ask量{交易所1,量1}{交易所2,量2}); "pdd(symbol\_id,trade\_type,trade\_mode,seq,tick\_time);(price\_bid1,volume\_bid1{exchange1,volume1}{exchange2,volume2})(price\_bid2,volume\_bid2{exchange1,volume1}{exchange2,volume2});(price\_ask1,volume\_ask1{exchange1,volume1}{exchange2,volume2})(price\_ask2,volume\_ask2{exchange1,volume1}{exchange2,volume2});" trade\_type的值含义 1:全仓合约,2:逐仓合约,3:杠杆,5:现货,6:股票 trade\_mode的值含义 1:MM,2:蝴蝶MM,3:撮合,4:聚合

### 推送数据示例

"pdd(1123,1,0,1232312,34545435345);(6.23,123{BA,100}{HB,23})(6.22,256{BA,200}{HB,56});(6.24,111{BA,100}{HB,11})(6.25,222{BA,200}{HB,22});" "pdd(1123,1,0,1232312,34545435345);(6.23,123{BA,100}{HB,23})(6.22,256{BA,200}{HB,56});(6.24,111{BA,100}{HB,11})(6.25,222{BA,200}{HB,22})(6.25,333{BA,300}{HB,33});" "pdd(1123,1,0,1232312,34545435345);;(6.24,111{BA,100}{HB,11})(6.25,222{BA,200}{HB,22})(6.25,333{BA,300}{HB,33});"


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-cn.multimarkets.org/client-api/bao-jia-jie-kou/ding-yue-jie-kou/ju-he-pan-kou-cheng-jiao-bao-jia-ding-yue.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
