Ws Place batch orders

place_batch_orders

Signature verification: Yes

Interface permission: Trade

Rate Limit: Shared REST frequency limit

Interface description: This interface only supports websocket contract batch orders.

Subscription Address

Environment
Address

Online

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

Online (preferred by aws customers)

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

Subscription Parameter

Field Name
Type
Description

op

string

Required; Operator Name, place_batch_orders

cid

string

Optional; Requests unique ID

data

array

batch order parameters

Request Parameter

Parameter
Data Type
Required
Description
Value Range
Default Value

<data>

false

contract_code

String

false

Symbol

margin_mode

String

false

Margin mode: cross (Cross margin)

position_side

String

false

Position side

long: going long; short: going short; both: One-way mode. You must input long or short and both is default.

side

String

false

Order side

buy; sell

type

String

false

Order type; enumeration

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

price_match

String

false

BBO and price are mutually exclusive

opponent: counterparty price; "optimal_5": Best 5 BBO; "optimal_10": Best 10 BBO; "optimal_20": Best 20 BBO

client_order_id

String

false

Order ID you entered

Clients fill and maintain themselves. the value must be in [1, 9223372036854775807]

price

String

false

Price, applicable for limit orders only. No price input is required for market orders.

volume

String

false

Order size, specifically in Cont

reduce_only

Integer

false

Reduce only: 0 is false; 1 is true

time_in_force

String

false

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

tp_trigger_price

String

false

Trigger price of your take profit order

tp_order_price

String

false

Price of your take profit order. (There is no need to input a price when using BBO.)

tp_type

String

false

Type of your take profit order. "market" is default with no input. "market": market order; "limit": limit order. "optimal_5": Best 5 BBO; "optimal_10": Best 10 BBO; "optimal_20": Best 20 BBO.

tp_trigger_price_type

String

false

Trigger price type of your take profit order. The last price is default.

"last": last price; "market": mark price

sl_trigger_price

String

false

SL Trigger Price

sl_order_price

String

false

Price of your stop loss order. (There is no need to input a price when using BBO.)

sl_type

String

false

Type of your stop loss order. "market" is default with no input. "market": market order; "limit": limit order. "optimal_5": Best 5 BBO; "optimal_10": Best 10 BBO; "optimal_20": Best 20 BBO.

sl_trigger_price_type

String

false

Trigger price type of your stop loss order. The last price is default.

"last": last price; "market": mark price

price_protect

boolean

false

Price protection. "false" is default. The parameter is needed when you set TP/SL.

false or true

self_match_prevent

String

false

Self-trading prevention

Currently only supports cancel_taker

The default is cancel_taker

<data>

false

Notes: Notes: position_side is the side of your position. This parameter is optional in the One-way mode. The field is optional, and only "both" can be entered. However, in Hedge mode, this field is mandatory, and only "long" or "short" can be selected. In Hedge mode, "side" and "position_side" need to be combined. Open long (Enter "buy" in the side field; "long" in the position_side field) Open short (Enter "sell" in the side field; "short" in the position_side field) Close long (Enter "sell" in the side field; "long" in the position_side field) Close short (Enter "buy" in the side field; "short" in the position_side field) In One-way mode, a long position returns "buy," while a short position returns "sell."

Response Parameter

Parameter
Data Type
Required
Description
Value Range

code

int

true

Response Code

200: Success, non 200: Error

message

String

true

Response Description

<data>

object array

true

code

int

true

Order Response Code

200: Success, non 200: Error

message

String

true

Order Response Description

order_id

String

true

Order 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.

</data>

false

ts

long

true

Request Example

Example of a Successful Request

Last updated