订阅撮合后的订单数据

match_orders.$contract_code

是否验签: 是

接口权限: 读取

限频: WebSocket私有订单成交推送接口(需要API KEY验签) 一个UID最多同时建立30个私有订单成交推送WS链接。该用户在一个品种(包含该品种的所有周期的合约)上,仅需要维持一个订单推送WS链接即可。 单个链接为50次/秒的请求,单个IP链接为100次/秒的请求。 注意: 订单推送WS的限频,跟用户RESTFUL私有接口的限频是分开的,相互不影响。

接口描述: 当订单发生下单、订单撤单、成交等事件时,从撮合里引擎面推送消息

订阅地址

环境
地址

线上环境

wss://api.sunx.io/ws/v1/notification

线上环境(aws客户首选)

wss://api.sunx.io/ws/v1/notification

请求参数

字段名称
类型
说明

op

string

必填;操作名称,sub 或 unsub;

cid

string

选填;Client 请求唯一 ID

topic

string

必填; match_orders

contract_code

string

必填; contract_code * 或者 BTC-USDT 或者 BTC-USDT-240909

规则说明

订阅(sub)
取消订阅(unsub)
规则

*

*

允许

*

contract_code

不允许

订阅参数

参数
数据类型
是否必填
描述
取值范围
默认值

contract_code

string

true

合约代码,支持大小写

全部:*(交割和永续), 永续:“BTC-USDT:... ,交割:"BTC-USDT-210625"...

数据更新

参数
数据类型
是否必填
描述
取值范围

op

String

true

操作名称,推送固定值为 notify;--可不可以去掉

topic

String

true

推送的主题

orders

ts

long

true

服务端应答时间戳

uid

String

true

用户uid

<data>

false

contract_code

String

true

合约代码

永续:"BTC-USDT"... ,交割:"BTC-USDT-210625"...

side

String

true

买卖方向

buy:买 "sell":卖

position_side

String

true

仓位方向

"long":多 "short":空 “both”:单向持仓

type

String

true

订单类型;枚举

"market": 市价,"limit":限价, "post_only":只挂单

price_match

String

true

价格匹配

行情当前没有

order_id

String

true

订单id

client_order_id

String

true

用户自定义订单ID

trade_id

String

true

成交id

margin_mode

String

true

保证金模式

枚举 cross

price

String

true

委托价格

volume

String

true

委托数量

lever_rate

String

true

废弃参数

state

int

true

订单状态

new, partially_filled, partially_canceled, filled ,canceled,

order_source

String

true

订单来源

(system:系统、web:用户网页、api:用户API、m:用户M站、risk:风控系统、settlement:交割结算、ios:ios客户端、android:安卓客户端、windows:windows客户端、mac:mac客户端、trigger:计划委托触发、tpsl:止盈止损触发、ADL: adl订单)

time_in_force

String

true

枚举fok, ioc, gtc,非必填,默认是gtc

reduce_only

Boolean

true

只减仓

trade_price

String

true

成交均价

trade_volume

String

true

成交数量

total_trade_volume

String

true

累计成交数量

cancel_reason

String

false

撤单原因

"Limit order cancelation by the client":"用户主动撤销普通限价订单","Order cancelation by system":"系统撤单","Market order circuit-breaker":"市价单熔断","Bankruptcy price of market order":"市价单破产价","Order cancelation due to no matching orders":"没有对手盘导致撤单"," Self trading prevention":"防自成交撤单","Number of maker orders matched with your taker orders exceeding limit":"成交笔数超过最大限制","Order cancelation due to API timeout":"API超时撤单"

created_time

String

true

订单创建时间, UTC时间戳(MS)

match_time

String

true

撮合更新时间, UTC时间戳(MS)

撮合时间

self_match_prevent

String

true

防自成交

cancel_taker: 撤销taker单 cancel_maker:撤销maker单 cancel_both:撤销全部订单

<data>

false

订阅示例

订阅成功示例

数据更新示例

最后更新于