Subscribe to data of execution changes
trade.$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 execution happens, the following messages will be sent.
Subscription Address
Online
wss://api.sunx.io/ws/v1/notification
Online (preferred by aws customers)
wss://api.sunx.io/ws/v1/notification
Request Parameter
op
string
Must. Use sub or unsub.
cid
string
Optional. The unique ID of the client.
topic
string
Must. trade_$contract_code
contract_code
string
Must. Perpetual: "BTC-USDT"...; Delivery: "BTC-USDT-210625"...
Rule description
*
*
yes
*
contract_code1
no
Subscription Parameter
contract_code
string
true
Symbol. Case-insensitive
All: * (Delivery and perpetual); Perpetual: "BTC-USDT"...; Delivery: "BTC-USDT-210625"...
Data Update
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
A trading pairconsisting of two currencies: base currency and quote currency
order_id
String
true
Order ID
id
String
true
Trade ID
client_order_id
String
true
The order ID you entered when placing an order. The ID will not be returned if it is not provided.
side
String
true
Trade side
buy; sell
role
String
true
Execution Role: Maker, Taker
trade_price
String
true
Execution price
trade_volume
String
true
Execution amount (Cont)
trade_turnover
String
true
Total value executed (= Execution amount * Face value * Execution price)
created_time
String
true
Creation time
updated_time
String
true
Update time, defaulting to execution time
contract_type
String
true
Contract type
swap: Perpetual; this_week: Weekly; next_week: Bi-weekly; quarter: Quarterly; next_quarter: Bi-quarterly
<data>
false
position_side
String
true
Position direction
"long":,"short",“both”
Subscription Example
Example of a Successful Subscription
Example of a Data Update
Last updated