Subscribe to match order data

match_orders.$contract_code

Signature verification: Yes

Interface permission: Read

Rate Limit: WebSocket private order transaction push interface (API KEY verification is required) A UID can establish up to 30 private order transaction push WS links at the same time. The user only needs to maintain one order push WS link on one product (including all periodic contracts of the product). A single link is 50 requests per second, and a single IP link is 100 requests per second. Note: The frequency limit of the order push WS is separate from the frequency limit of the user's RESTFUL private interface and does not affect each other.

Interface description: When events such as order placement, order cancellation, and transaction occur, messages are pushed from the matching engine.

Subscription Address

Environment
Address

Online

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

Online (preferred by aws customers)

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

Request Parameter

Field Name
Type
Description

op

string

Must. Use sub or unsub.

cid

string

Optional. The unique ID of the client.

topic

string

Must. match_orders

contract_code

string

Must. Perpetual: "BTC-USDT"...; Delivery: "BTC-USDT-210625"...

Rule description

Subscribe(sub)
Unsubscribe( unsub )
Rule

*

*

Yes

*

contract_code

No

Subscription Parameter

Parameter
Data Type
Required
Description
Value Range
Default Value

contract_code

string

true

Symbol. Case-insensitive

All: * (Delivery and perpetual); Perpetual: "BTC-USDT"...; Delivery: "BTC-USDT-210625"...

Data Update

Parameter
Data Type
Required
Description
Value Range

op

String

true

Operation name, with a fixed value of "notify"

topic

String

true

Push topic

ts

Long

true

Timestamp of server response

uid

String

true

User UID

<data>

false

contract_code

String

true

Symbol

Perpetual: "BTC-USDT"...; Delivery: "BTC-USDT-210625"...

side

String

true

Buy or Sell

buy; sell

position_side

String

true

Position side

long: going long; short: going short; both: One-way mode

type

String

true

Order type; enumeration

"market": market order; "limit": limit order; "post_only": post-only order

price_match

String

true

Price matching

order_id

String

true

Order ID

client_order_id

String

true

Order ID you entered

margin_mode

String

true

Margin mode

Cross margin; enumeration

price

String

true

Price

volume

String

true

Amount

lever_rate

Long

true

Discarded parameters

state

String

true

Status

new, partially_filled, filled, partially_canceled, canceled, and rejected

order_source

String

true

Order source

system: System; web: Website for PC clients, api: API, m: Website for mobile clients, risk: Risk management system, settlement: Delivery settlement, ios: iOS clients, android: Android clients, windows: Windows clients, mac: Mac clients, trigger: Conditional order trigger, tpsl: Take profit or stop loss order, ADL: Auto deleveraging orders

reduce_only

Boolean

true

Reduce only

time_in_force

String

true

Enumerate FOK, IOC, and GTC. It is an optional field with GTC by default.

trade_price

String

true

Average execution price

trade_volume

String

true

Execution amount

total_trade_volume

String

true

Cumulative transaction volume

cancel_reason

String

true

cancel reason

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

created_time

String

true

Order creation time with a UTC timestamp (MS)

match_time

String

true

Match time with a UTC timestamp (MS)

self_match_prevent

String

true

Self-trading prevention

cancel_taker: Cancel a taker order cancel_maker: Cancel a maker order cancel_both: Cancel all orders

<data>

false

Subscription Example

Example of a Successful Subscription

Example of a Data Update

Last updated