NOTICE: These docs are now OBSOLETE; please find the new documentation here. Thank you.
-
For testnet https://api-testnet.bybit.com
-
For mainnet https://api.bybit.com
-
Place active order----The V2 version is recommended to use. -
Cancel active order----The V2 version is recommended to use.
-
My position----The V2 version is recommended to use.
Get bybit server time。
GET
/v2/public/time
parameter | required | type | comments |
---|
{
'ret_code':0 //Error code - True
'ret_msg':'ok' //Error message
'ext_code':'' ,
'result':{
},
'time_now':'1539778407.210858', //UTC timestamp, used for time calibration
}
Get bybit OpenAPI announcements in the last 30 days。
GET
/v2/public/announcement
parameter | required | type | comments |
---|
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": [{
"id": 1,
"title": "New API",
"link": "https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/CHANGELOG.md",
"summary": "Add announcement api",
"created_at": "2019-10-29T11:24:01Z"//publish time
}, {
"id": 3,
"title": "Update API",
"link": "https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/CHANGELOG.md",
"summary": "Update get stop order list",
"created_at": "2019-10-29T12:26:43Z"
}],
"time_now": "1572580751.222836"
}
Get User API key Info。
GET
/open-api/api-key
parameter | required | type | comments |
---|
{
"ret_code": 0,
"ret_msg": "ok",
"ext_code": "",
"result": [
{
"api_key": "zh2PIPKrIH1ewaRZ1l", //API key
"user_id": 160249, //user id
"type": "personal", //personal or third-party application name such as aicoin
"ips": [ //bind ip type to a third-party application to return a request whitelist
"173.194.72.139"
],
"note": "stephen",
"permissions": [ //permissions
"Order",
"Position"
],
"created_at": "2019-08-13T10:07:17.000Z", //create time
"expired_at": null, // expire time: null is forever
"read_only": true //read only flag
}
],
"ext_info": null,
"time_now": "1570869813.399178"
}
Parameters of 'side', 'symbol', 'order_type', 'qty', 'price', 'time_in_force' are required for all active orders. Other parameters are optional unless specified.
Market price active order: A traditional market price order, will be filled at the best available price. 'price' can set to be "" if and only if you are placing market price order.
Limit price active order: You can set an execution price for your order. Only when last traded price reaches the order price, the system will fill your order.
Take profit/Stop loss: You may only set a take-profit/stop-loss conditional order upon opening the position. Once you hold a position, the take profit and stop loss information u sent when placing an order will no longer be valid.
Order quantity: This parameter indicates the quantity of perpetual contracts you want to buy or sell, currently Bybit only support order quantity in an integer.
Order price: This parameter indicates the price of perpetual contracts you want to buy or sell, you can get price increment by Query symbols endpoint
Customize conditional order ID: You may customize order IDs for active orders. We will link it to the system order ID , and return the unique system order ID to you after the active order is created successfully. You may use this order ID to cancel your active order. The customized order ID is asked to be unique, with a maximum length of 36 characters.
Notes:
- Each account can hold up to 500 active orders yet to be filled entirely simultaneously.
- 'order_status' values explained:
- 'Created' indicates the order has been accepted by the system but not yet entered into the orderbook
- 'New' indicates the order has entered into the orderbook.
POST
/open-api/order/create
parameter | required | type | comments |
---|---|---|---|
side | true | string | Side |
symbol | true | string | Contract type. |
order_type | true | string | Active order type |
qty | true | integer | Order quantity. |
price | false | number | Order price. Required if you make limit price order |
time_in_force | true | string | Time in force |
take_profit | false | number | take profit price |
stop_loss | false | number | stop loss price |
reduce_only | false | bool | reduce only |
close_on_trigger | false | bool | close on trigger. When creating closing order, highly recommend to set as true to avoid failing by insufficient avaliable margin |
order_link_id | false | string | Customized order ID, maximum length at 36 characters, and order ID under the same agency has to be unique. |
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": {
"user_id": 160744,
"symbol": "BTCUSD",
"side": "Sell",
"order_type": "Limit",
"price": "8083",
"qty": 10,
"time_in_force": "GoodTillCancel",
"order_status": "New",
"ext_fields": {
"o_req_num": -308787,
"xreq_type": "x_create",
"xreq_offset": 4154640
},
"leaves_qty": 10,
"leaves_value": "0.00123716",
"cum_exec_qty": 0,
"reject_reason": "",
"order_link_id": "",
"created_at": "2019-10-21T07:28:19.396246Z",
"updated_at": "2019-10-21T07:28:19.396246Z",
"order_id": "efa44157-c355-4a98-b6d6-1d846a936b93"
},
"time_now": "1571651135.291930"
}
Parameters of 'side', 'symbol', 'order_type', 'qty', 'price', 'time_in_force' are required for all active orders. Other parameters are optional unless specified.
Market price active order: A traditional market price order, will be filled at the best available price. 'price' can set to be "" if and only if you are placing market price order.
Limit price active order: You can set an execution price for your order. Only when last traded price reaches the order price, the system will fill your order.
Take profit/Stop loss: You may only set a take-profit/stop-loss conditional order upon opening the position. Once you hold a position, the take profit and stop loss information u sent when placing an order will no longer be valid.
Order quantity: This parameter indicates the quantity of perpetual contracts you want to buy or sell, currently Bybit only support order quantity in an integer.
Order price: This parameter indicates the price of perpetual contracts you want to buy or sell, you can get price increment by Query symbols endpoint.
Customize conditional order ID: You may customize order IDs for active orders. We will link it to the system order ID , and return the unique system order ID to you after the active order is created successfully. You may use this order ID to cancel your active order. The customized order ID is asked to be unique, with a maximum length of 36 characters.
Notes:
- Each account can hold up to 500 active orders yet to be filled entirely simultaneously.
- 'order_status' values explained:
- 'Created' indicates the order has been accepted by the system but not yet entered into the orderbook
- 'New' indicates the order has entered into the orderbook.
POST
/v2/private/order/create
parameter | required | type | comments |
---|---|---|---|
side | true | string | Side |
symbol | true | string | Contract type. |
order_type | true | string | Active order type |
qty | true | integer | Order quantity. |
price | false | number | Order price. Required if you make limit price order |
time_in_force | true | string | Time in force |
take_profit | false | number | take profit price |
stop_loss | false | number | stop loss price |
reduce_only | false | bool | reduce only |
close_on_trigger | false | bool | close on trigger. When creating closing order, highly recommend to set as true to avoid failing by insufficient avaliable margin |
order_link_id | false | string | Customized order ID, maximum length at 36 characters, and order ID under the same agency has to be unique. |
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": {
"user_id": 105008,
"order_id": "335fd977-e5a5-4781-b6d0-c772d5bfb95b",
"symbol": "BTCUSD",
"side": "Buy",
"order_type": "Limit",
"price": 8800,
"qty": 1,
"time_in_force": "GoodTillCancel",
"order_status": "New",
"last_exec_time": 0,
"last_exec_price": 0,
"leaves_qty": 1,
"cum_exec_qty": 0,
"cum_exec_value": 0,
"cum_exec_fee": 0,
"reject_reason": "",
"order_link_id": "",
"created_at": "2019-11-30T11:03:43.452Z",
"updated_at": "2019-11-30T11:03:43.455Z"
},
"time_now": "1575111823.458705",
"rate_limit_status": 99,
"rate_limit_reset_ms": 1575111823448,
"rate_limit": 100
}
Get my active order list
Order creation/cancellation is asynchronous.If you want real-time information about an order, you can call Real-time query Active Order information
GET
/open-api/order/list
parameters | required | type | comments |
---|---|---|---|
order_id | false | string | Order ID |
order_link_id | false | string | Customized order ID |
symbol | false | string | Contract type. Default BTCUSD |
order | false | string | Sort orders by creation date |
page | false | integer | Page. Default getting first page data |
limit | false | integer | Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page |
order_status | false | string | Query your orders for all statuses if 'order_status' is empty. If you want to query orders with specific statuses , you can pass the order_status split by ','. |
{
'ret_code':0,
'ret_msg':'ok',
'ext_code':'',
'result':{
'data':[
{
'order_id': 'string', //Unique order ID
'user_id': 0, //User ID
'symbol': 'string', //Contract type
'side': 'string', //Side
'order_type': 'string', //Order type
'price': 0, //Order price
'qty': 0, //Order quantity
'time_in_force': 'string', //Time in force
'order_status': 'string', //Order status: Created: order created; Rejected: order rejected; New: order pending; PartiallyFilled: order filled partially; Filled: order filled fully, Cancelled: order cancelled
'last_exec_time': 0.000000 , //Last execution time
'last_exec_price': 0, //Last execution price
'leaves_qty': 0, //Remaining order quantity
'cum_exec_qty': 0, //Accumulated execution quantity
'cum_exec_value': 0, //Accumulated execution value
'cum_exec_fee': 0, //Accumulated execution fee
'reject_reason': 'string', //Reason for rejection
'order_link_id': 'string', //Agency customized order ID
'created_at':'2018-10-15T04:12:19.000Z',
'updated_at':'2018-10-15T04:12:19.000Z',
}
],
'current_page': 1,
'total': 1
},
'time_now':'1539781050.462841'
}
'order_id' is required for cancelling active order. The unique 36 characters order ID was returned to you when the active order was created successfully. 'symbol' is highly recommend filled, Otherwise, there will be a small probability of failure.
You may cancel active order that are unfilled and partially filled. Fully filled order cannot be cancelled.
POST
/open-api/order/cancel
parameters | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type. |
order_id | false | string | Your active order ID. The unique order ID returned to you when the corresponding active order was created. Required if not pass order_link_id |
order_link_id | false | string | Agency customized order ID. Required if not pass order_id |
{
'ret_code':0 //Error code - True
'ret_msg':'ok' //Error message
'ext_code':'' ,
'result':{
'order_id': 'string', //Unique order ID
'user_id': 0, //User ID
'symbol': 'string', //Contract type
'side': 'string', //Side
'order_type': 'string', //Order type
'price': 0, //Order price
'qty': 0, //Order quantity
'time_in_force': 'string', //Time in force
'order_status': 'string', //Order status: Created: order created; Rejected: order rejected; New: order pending; PartiallyFilled: order filled partially; Filled: order filled fully, Cancelled: order cancelled
'last_exec_time': 0.000000, //Last execution time
'last_exec_price': 0, //Last execution price
'leaves_qty': 0, //Remaining order quantity
'cum_exec_qty': 0, //Accumulated execution quantity
'cum_exec_value': 0, //Accumulated execution value
'cum_exec_fee': 0, //Accumulated execution fee
'reject_reason': 'string', //Reason for rejection
'order_link_id': 'string', //Agency customized order ID
'created_at':'2018-10-15T04:12:19.000Z',
'updated_at':'2018-10-15T04:12:19.000Z',
},
'time_now':'1539778407.210858', //UTC timestamp
}
'order_id' is required for cancelling active order. The unique 36 characters order ID was returned to you when the active order was created successfully. 'symbol' is highly recommend filled, Otherwise, there will be a small probability of failure.
You may cancel active order that are unfilled and partially filled. Fully filled order cannot be cancelled.
POST
/v2/private/order/cancel
parameters | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
order_id | false | string | Order Id。Required if without order_link_id |
order_link_id | false | string | Order link id. Required if without order_id |
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": {
"user_id": 105008,
"order_id": "3bd1844f-f3c0-4e10-8c25-10fea03763f6",
"symbol": "BTCUSD",
"side": "Buy",
"order_type": "Limit",
"price": 8800,
"qty": 1,
"time_in_force": "GoodTillCancel",
"order_status": "New",
"last_exec_time": 0,
"last_exec_price": 0,
"leaves_qty": 1,
"cum_exec_qty": 0,
"cum_exec_value": 0,
"cum_exec_fee": 0,
"reject_reason": "",
"order_link_id": "",
"created_at": "2019-11-30T11:17:18.396Z",
"updated_at": "2019-11-30T11:18:01.811Z"
},
"time_now": "1575112681.814760",
"rate_limit_status": 99,
"rate_limit_reset_ms": 1575112681807,
"rate_limit": 100
}
Cancel all active orders that are unfilled or partially filled. Fully filled orders cannot be cancelled.
This endpoint's
rate_limit
will decrease by 10 per request
POST
/v2/private/order/cancelAll
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": [
{
"clOrdID": "89a38056-80f1-45b2-89d3-4d8e3a203a79",
"user_id": 105008,
"symbol": "BTCUSD",
"side": "Buy",
"order_type": "Limit",
"price": "7693.5",
"qty": 1,
"time_in_force": "GoodTillCancel",
"create_type": "CreateByUser",
"cancel_type": "CancelByUser",
"order_status": "",
"leaves_qty": 1,
"leaves_value": "0",
"created_at": "2019-11-30T10:38:53.564428Z",
"updated_at": "2019-11-30T10:38:59.102589Z",
"cross_status": "PendingCancel", // `PendingCancel` means the matching engine received the cancellation but there is no guarantee that the cancellation will be successful.
"cross_seq": 387734027
}
],
"time_now": "1575110339.105675",
"rate_limit_status": 98,
"rate_limit_reset_ms": 1575110339100,
"rate_limit": 100
}
Replace-order can modify your active order.
'order_id' and 'symbol' is required for finding an active order.'p_r_qty' and 'p_r_price 'are the modified price and quantity. If these two fields are not provided, nothing will be modified.
Please note that only orders that are unfilled and partially filled can be modified by the replace-order api
POST
/open-api/order/replace
parameters | required | type | comments |
---|---|---|---|
order_id | true | string | Your active order ID. The unique order ID returned to you when the corresponding active order was created |
symbol | true | string | Contract type. |
p_r_qty | false | int | New order quantity. Do not pass this field if you don't want modify it. |
p_r_price | false | number | New order price. Do not pass this field if you don't want modify it. |
{
'ret_code':0 //Error code,
'ret_msg':'ok' //Error message,
'ext_code':'',
'result':{
'order_id': '89a38056-80f1-45b2-89d3-4d8e3a203a79'
},
'time_now':'1539778407.210858', // UTC timestamp
'rate_limit_status': 0, // The remaining number of accesses in one minute
}
Query real-time active order information
GET
/v2/private/order
parameter | required | type | comments |
---|---|---|---|
order_id | false | string | Your active order ID. The unique order ID returned to you when the corresponding active order was created. Required if not pass order_link_id. |
order_link_id | false | string | Agency customized order ID. Required if not pass order_id . |
symbol | true | string | Contract type |
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": {
"user_id": 160744,
"symbol": "BTCUSD",
"side": "Sell",
"order_type": "Limit",
"price": "8083",
"qty": 10,
"time_in_force": "GoodTillCancel",
"order_status": "New",
"ext_fields": {
"o_req_num": -308787,
"xreq_type": "x_create",
"xreq_offset": 4154640
},
"leaves_qty": 10,
"leaves_value": "0.00123716",
"cum_exec_qty": 0,
"reject_reason": "",
"cancel_type": "CancelByUser",
"order_link_id": "",
"created_at": "2019-10-21T07:28:19.396246Z",
"updated_at": "2019-10-21T07:28:19.396246Z",
"order_id": "efa44157-c355-4a98-b6d6-1d846a936b93"
},
"time_now": "1571651135.291930"
}
Parameters of 'side', 'symbol', 'order_type', 'qty', 'price', 'base_price', 'stop_px', 'time_in_force' are required for all active orders. Other parameters are optional unless specified.
Market price conditional order: A traditional market price order, will be filled at the best available price. 'price' can set to be "" if and only if you are placing market price order.
Limit price conditional order: You can set an execution price for your order. Only when last traded price reaches the order price, the system will fill your order.
Take profit/Stop loss: You may only set a take-profit/stop-loss conditional order upon opening the position. Once you hold a position, the take profit and stop loss information u sent when placing an order will no longer be valid.
Order quantity: This parameter indicates the quantity of perpetual contracts you want to buy or sell, currently Bybit only support order quantity in an integer.
Order price: This parameter indicates the price of perpetual contracts you want to buy or sell, you can get price increment by Query symbols endpoint.
Conditional order trigger price: You may set a trigger price for your conditional order. conditional order will not enter the order book until the last price hits the trigger price. When last price hits trigger price: 1) your limit conditional order will enter order book, and wait to be executed; 2) your market conditional order will be executed immediately at the best available market price.
Customize conditional order ID: You may customize order IDs for active orders. We will link it to the system order ID , and return the unique system order ID to you after the active order is created successfully. You may use this order ID to cancel your active order. The customized order ID is asked to be unique, with a maximum length of 36 characters.
Note: Take profit/Stop loss is not supported in placing conditional orders. One can only use these 2 functions when placing active orders. Moreover, each account can hold up to 10 conditional orders yet to be filled entirely simultaneously.
POST
/open-api/stop-order/create
parameter | required | type | comments |
---|---|---|---|
side | true | string | Side. |
symbol | true | string | Contract type. |
order_type | true | string | Conditional order type. |
qty | true | integer | Order quantity. |
price | false | number | Execution price for conditional order. Required if you make limit price order |
base_price | true | number | It will be used to compare with the value of 'stop_px', to decide whether your conditional order will be triggered by crossing trigger price from upper side or lower side. Mainly used to identify the expected direction of the current conditional order. |
stop_px | true | number | Trigger price |
time_in_force | true | string | Time in force |
trigger_by | false | string | Trigger price type. Default LastPrice |
close_on_trigger | false | bool | close on trigger. When creating closing order, highly recommend to set as true to avoid failing by insufficient avaliable margin |
order_link_id | false | string | Customized order ID, maximum length at 36 characters, and order ID under the same agency has to be unique. |
{
'ret_code':0 //Error code - True
'ret_msg':'ok' //Error message
'ext_code':'' ,
'result':{
'stop_order_id': 'string', //Unique order ID
'user_id': 0, //User ID
'stop_order_status': 'string', //Order status: Untriggered: order waits to be triggered; Triggered: order is triggered; Cancelled: order is cancelled, Active: order is triggered and placed successfully; Rejected: Order is triggered but fail to be placed
'symbol': 'string', //Contract type
'side': 'string', //Side
'order_type': 'string', //Price type
'price': 0, //Order price
'qty': 0, //Order quantity
'time_in_force': 'string', //Time in force
'stop_order_type': 'string', //Order type
'base_price': 0, //
'stop_px': 0, //trigger price
'order_link_id': 'string', //Agency customized order ID
'created_at':'2018-10-15T04:12:19.000Z',
'updated_at':'2018-10-15T04:12:19.000Z',
},
'time_now':'1539778407.210858', //UTC timestamp
}
Get my conditional order list。
GET
/open-api/stop-order/list
parameter | required | type | comments |
---|---|---|---|
stop_order_id | false | string | Order ID of conditional order |
order_link_id | false | string | Agency customized order ID |
symbol | false | string | Contract type. Default BTCUSD |
stop_order_status | false | string | stop order status |
order | false | string | Sort orders by creation date |
page | false | integer | Page. Default getting first page data |
limit | false | integer | Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page |
{
'ret_code':0,
'ret_msg':'ok',
'ext_code':'',
'result':{
'data':[
{
'stop_order_id': 'string', //Unique order ID
'user_id': 0, //User ID
'stop_order_status': 'string', //Order status: Untriggered: Pending order waits to be triggered; Triggered: order is triggered; Cancelled: order is cancelled, Active: order is triggered and placed successfully; Rejected: Order is triggered but fail to be placed
'symbol': 'string', //Contract type
'side': 'string', //Side
'order_type': 'string', //Price type
'price': 0, //Order price
'qty': 0, //Order quantity
'time_in_force': 'string', //Time in force
'stop_order_type': 'string', //Order type
'base_price': 0, //
'stop_px': 0, //trigger price
'order_link_id': 'string', //Agency customized order ID
'created_at':'2018-10-15T04:12:19.000Z',
'updated_at':'2018-10-15T04:12:19.000Z',
}
],
'current_page': 1,
'total': 1
},
'time_now':'1539781050.462841'
}
'stop_order_id' is required for cancelling conditional order. The unique 36 characters order ID was returned to you when the condional order was created successfully.
You may cancel all untriggered conditional orders. Essentially, after a conditional order is triggered, it will become an active order. So, when a conditional order is triggered, cancellation has to be done through the active order port for all unfilled or partial filled active order. Similarly, order that has been fully filled cannot be cancelled.
POST
/open-api/stop-order/cancel
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
stop_order_id | false | string | Order ID. The unique order ID returned to you when the corresponding order was created. Required if not pass order_link_id |
order_link_id | false | string | Agency customized order ID. Required if not pass stop_order_id |
{
'ret_code':0 //Error code - True
'ret_msg':'ok' //Error message
'ext_code':'' ,
'result':{
'stop_order_id': 'string', //Unique order ID
'user_id': 0, //User ID
'stop_order_status': 'string', //Order status: Untriggered: order waits to be triggered; Triggered: order is triggered; Cancelled: order is cancelled, Active: order is triggered and placed successfully; Rejected: Order is triggered but fail to be placed
'symbol': 'string', //Contract type
'side': 'string', //Side
'order_type': 'string', //Price type
'price': 0, //Order price
'qty': 0, //Order quantity
'time_in_force': 'string', //Time in force
'stop_order_type': 'string', //Order type
'base_price': 0, //
'stop_px': 0, //trigger price
'order_link_id': 'string', //Agency customized order ID
'created_at':'2018-10-15T04:12:19.000Z',
'updated_at':'2018-10-15T04:12:19.000Z',
},
'time_now':'1539778407.210858', //UTC timestamp
}
Cancel all untriggered conditional orders.
This endpoint's
rate_limit
will decrease by 10 per request
POST
/v2/private/stop-order/cancelAll
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": [
{
"clOrdID": "041e523d-2376-42c7-9998-252a5fff9e75",
"user_id": 105008,
"symbol": "BTCUSD",
"side": "Buy",
"order_type": "Limit",
"price": "7694.5",
"qty": 1,
"time_in_force": "GoodTillCancel",
"create_type": "CreateByUser",
"cancel_type": "CancelByUser",
"order_status": "",
"leaves_qty": 1,
"leaves_value": "0",
"created_at": "2019-11-30T10:49:48.139157Z",
"updated_at": "2019-11-30T10:49:57.646802Z",
"cross_status": "Deactivated", // `Deactivated` means the conditional order was cancelled before triggering
"cross_seq": -1,
"stop_order_type": "Stop",
"trigger_by": "LastPrice",
"base_price": "7689.5",
"expected_direction": "Rising"
}
],
"time_now": "1575110997.668109",
"rate_limit_status": 99,
"rate_limit_reset_ms": 1575110997643,
"rate_limit": 100
}
Replace conditional order can modify your conditional order.
'p_r_qty', 'p_r_price' and 'p_r_trigger_price' will be set to your new conditional order. If these fields are not provided, nothing will be modified.
Please note that you can only modify untriggered conditional order.
POST
/open-api/stop-order/replace
parameters | required | type | comments |
---|---|---|---|
order_id | true | string | Abandoned! Alias for stop_order_id |
stop_order_id | true | string | Your stop order ID. The unique order ID returned to you when the corresponding conditional order was created |
symbol | true | string | Contract type. |
p_r_qty | false | int | New conditional order's quantity |
p_r_price | false | number | New conditional order's price |
p_r_trigger_price | false | number | New conditional order's tirgger price |
{
'ret_code':0 //Error code,
'ret_msg':'ok' //Error message,
'ext_code':'',
'result':{
'stop_order_id':'041e523d-2376-42c7-9998-252a5fff9e75'
},
'time_now':'1539778407.210858', // UTC timestamp
'rate_limit_status': 0, // The remaining number of accesses in one minute
}
Query real-time stop order information
GET
/v2/private/stop-order
parameter | required | type | comments |
---|---|---|---|
stop_order_id | false | string | Your stop order ID. The unique order ID returned to you when the corresponding active order was created. Required if not pass order_link_id. |
order_link_id | false | string | Agency customized order ID. Required if not pass order_id. |
symbol | true | string | Contract type |
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": {
"user_id": 160744,
"symbol": "BTCUSD",
"side": "Sell",
"order_type": "Limit",
"price": "8083",
"qty": 10,
"time_in_force": "GoodTillCancel",
"order_status": "New",
"ext_fields": {
"o_req_num": -308787,
"xreq_type": "x_create",
"xreq_offset": 4154640
},
"leaves_qty": 10,
"leaves_value": "0.00123716",
"cum_exec_qty": 0,
"reject_reason": "",
"order_link_id": "",
"created_at": "2019-10-21T07:28:19.396246Z",
"updated_at": "2019-10-21T07:28:19.396246Z",
"order_id": "efa44157-c355-4a98-b6d6-1d846a936b93"
},
"time_now": "1571651135.291930"
}
Get user leverage
GET
/user/leverage
parameter | required | type | comments |
---|
{
'ret_code': 0, // return code (0: successful, -1: failed)
'ret_msg': 'ok', // error message
'ext_code': '', // error code
'result': {
'BTCUSD': {
'leverage': 1
},
'EOSUSD': {
'leverage': 1
},
'ETHUSD': {
'leverage': 1
},
'XRPUSD': {
'leverage': 1
}
},
'ext_info': null,
'time_now': '1567608910.732004', // UTC timestamp
'rate_limit_status': 74
}
Change user leverage Note that your position mode will be changed to Isolated Margin mode if you change your leverage from 0 to any other value
POST
/user/leverage/save
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
leverage | true | string | Leverage. 0 means Cross Margin mode - any other value means Isolated Margin mode` |
{
'ret_code':0 //return code (0: successful, -1: failed)
'ret_msg':'ok' //error message,
'ext_code':'' //error code,
'result': null, //One can decide whether a request is successful depending on ret_code. Will always return 'null'
'time_now':'1539778407.210858', //UTC timestamp
}
Get my position list
GET
/position/list
parameter | required | type | comments |
---|
{
'ret_code': 0, //return code (0: successful, -1: failed)
'ret_msg': 'ok', //error message
'ext_code': '', //error code
'result': [
{
'id': 1, //position ID
'user_id': 1, //user ID
'risk_id': 1, //risk limit ID
'symbol': 'BTCUSD', //Contract type
'side': 'None', //position Side (None, buy, sell)
'size': 0, //position size
'position_value': 0, //position value
'entry_price': 0, //entry price
'leverage': 1, //user leverage
'auto_add_margin': 0, //1 means Cross Margin mode, 0 means Isolated Margin mode
'position_margin': 0, //position margin
'liq_price': 999999, //liquidation price
'bust_price': 999999, //bankruptcy price
'occ_closing_fee': 0, //position closing
'occ_funding_fee': 0, //funding fee
'take_profit': 0, //take profit price
'stop_loss': 0, //stop loss price
'trailing_stop': 0, //trailing stop point
'position_status': 'Normal', //Status Normal (normal), Liq (Liquidation in process), ADL (ADL in process)
'deleverage_indicator': 1,
'oc_calc_data': '{\'blq\':\'0\',\'bmp\':\'0\',\'slq\':\'0\',\'smp\':\'0\'}',
'order_margin': 0, //Used margin by order
'wallet_balance': 0, //wallet balance .When in Cross Margin mode, the number minus your unclosed loss is your real wallet balance.
'unrealised_pnl': 0, //unrealised profit and loss
'realised_pnl': 0, //daily realized profit and loss
'cum_realised_pnl': 0, //Total realized profit and loss
'cum_commission': 0, //Total commissions
'cross_seq': 0, //
'position_seq': 2, //position sequence number
'created_at': '2018-10-18T07:15:51.000Z',
'updated_at': '2018-10-20T13:43:21.000Z'
}
],
'time_now': '1540043097.995523' //UTC timestamp
}
*
Get my position list
GET
/v2/private/position/list
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": {
"id": 20113,
"user_id": 105008,
"risk_id": 1,
"symbol": "BTCUSD",
"side": "Buy",
"size": 11,
"position_value": "0.00156216",
"entry_price": "7041.53223741",
"auto_add_margin": 0,
"leverage": "1",
"position_margin": "0.00156216",
"liq_price": "3530",
"bust_price": "3521",
"occ_closing_fee": "0.00000235",
"occ_funding_fee": "0",
"take_profit": "0",
"stop_loss": "0",
"trailing_stop": "0",
"position_status": "Normal",
"deleverage_indicator": 3,
"oc_calc_data": "{\"blq\":0,\"slq\":2,\"slv\":\"0.00025508\",\"bmp\":0,\"smp\":7840.6774,\"fq\":-9,\"bv2c\":1.00225,\"sv2c\":1.0007575}",
"order_margin": "0",
"wallet_balance": "0.48987387",
"realised_pnl": "0",
"unrealised_pnl": 0,
"cum_realised_pnl": "-1.51626124",
"cross_seq": 426783677,
"position_seq": 269647204,
"created_at": "2019-09-08T03:10:27Z",
"updated_at": "2019-12-18T05:24:53.672158Z"
},
"time_now": "1576649493.869901",
"rate_limit_status": 119,
"rate_limit_reset_ms": 1576649493866,
"rate_limit": 120
}
Update margin
Note that you can't change margin when your position is in Cross Margin mode
POST
/position/change-position-margin
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
margin | true | string | margin |
{
'ret_code':0 //return code (0: successful, -1: failed)
'ret_msg':'ok' //error message
'ext_code':'', //error code
'result': null, //One can decide whether a request is successful depending on ret_code. Will always return 'null'
'time_now':'1539778407.210858', //UTC timestamp
}
Set Trading-Stop Condition
POST
/open-api/position/trading-stop
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
take_profit | false | string | Not less than 0, 0 means cancel TP |
stop_loss | false | string | Not less than 0, 0 means cancel SL |
trailing_stop | false | string | Not less than 0, 0 means cancel TS |
{
"ret_code": 0,
"ret_msg": "ok",
"ext_code": "",
"result": {
'id': 1, //position ID
'user_id': 1, //user ID
'risk_id': 1, //risk limit ID
'symbol': 'BTCUSD', //Contract type
'side': 'None', //position Side (None, buy, sell)
'size': 0, //position size
'position_value': 0, //position value
'entry_price': 0, //entry price
'leverage': 1, //user leverage
'auto_add_margin': 0, //1 means Cross Margin mode, 0 means Isolated Margin mode
'position_margin': 0, //position margin
'liq_price': 999999, //liquidation price
'bust_price': 999999, //bankruptcy price
'occ_closing_fee': 0, //position closing
'occ_funding_fee': 0, //funding fee
'take_profit': 0, //take profit price
'stop_loss': 0, //stop loss price
'trailing_stop': 0, //trailing stop point
'position_status': 'Normal', //Status Normal (normal), Liq (Liquidation in process), ADL (ADL in process)
'deleverage_indicator': 1,
'oc_calc_data': '{\'blq\':\'0\',\'bmp\':\'0\',\'slq\':\'0\',\'smp\':\'0\'}',
'order_margin': 0, //Used margin by order
'wallet_balance': 0, //wallet balance. When in Cross Margin mod, the number minus your unclosed loss is your real wallet balance.
'unrealised_pnl': 0, //unrealised profit and loss
'realised_pnl': 0, //daily realized profit and loss
'cum_realised_pnl': 0, //Total realized profit and loss
'cum_commission': 0, //Total commissions
'cross_seq': 0, //
'position_seq': 2, //position sequence number
'created_at': '2018-10-18T07:15:51.000Z',
'updated_at': '2018-10-20T13:43:21.000Z'
},
"time_now": "1569304018.857490"
}
Get wallet fund records
GET
/open-api/wallet/fund/records
parameter | required | type | comments |
---|---|---|---|
start_date | false | string | Start point for result |
end_date | false | string | End point for result |
currency | false | string | Currency type |
coin | false | string | currency alias |
wallet_fund_type | false | string | Wallet fund type |
page | false | integer | Page. Default getting first page data |
limit | false | integer | Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page |
{
"ret_code": 0, //Error code 0 means success
"ret_msg": "ok", //Error message
"ext_code": "",
"result": {
"data": [{
"id": 128495, //id
"user_id": 103669, //user id
"coin": "XRP", //coin type
"wallet_id": 14760, //wallet id
"type": "Realized P&L", //funding type
"amount": "1.18826225",
"tx_id": "",
"address": "XRPUSD", //address
"wallet_balance": "999.12908894", //balance
"exec_time": "2019-09-25T00:00:15.000Z",
"cross_seq": 0
}]
},
"time_now": "1569395810.140869"
}
Get withdraw records
GET
/open-api/wallet/withdraw/list
parameter | required | type | comments |
---|---|---|---|
start_date | false | string | Start point for result |
end_date | false | string | End point for result |
coin | false | string | Currency |
status | false | string | Withdraw status |
page | false | integer | Page. Default getting first page data |
limit | false | integer | Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page |
{
"ret_code": 0, //Error code 0 means success
"ret_msg": "ok", //error message
"ext_code": "",
"result": {
"data": [{
"id": 137, //id
"user_id": 160249, //user id
"coin": "XRP", //coin type
"status": "Pending", //status
"amount": "20.00000000", //amount
"fee": "0.25000000",
"address": "rH7H595XYEVTEHU2FySYsWnmfACBnZS9zM",
"tx_id": "",
"submited_at": "2019-06-11T02:20:24.000Z",
"updated_at": "2019-06-11T02:20:24.000Z"
}]
},
"ext_info": null,
"time_now": "1570863984.536136"
}
get wallet balance info
GET /v2/private/wallet/balance
parameter | required | type | comments |
---|---|---|---|
coin | true | BTC,EOS,XRP,ETH,USDT | coin |
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": {
"BTC": {
"equity": 1002, //equity = wallet_balance + unrealised_pnl
"available_balance": 999.99987471, //available_balance
//In Isolated Margin Mode, available_balance = wallet_balance - (position_margin + occ_closing_fee + occ_funding_fee + order_margin)
//In Cross Margin Mode,if unrealised_pnl > 0, available_balance = wallet_balance - (position_margin + occ_closing_fee + occ_funding_fee + order_margin);otherwise,available_balance = wallet_balance - (position_margin + occ_closing_fee + occ_funding_fee + order_margin) + unrealised_pnl
"used_margin": 0.00012529, //used_margin = wallet_balance - available_balance
"order_margin": 0.00012529, //Used margin by order
"position_margin": 0, //position margin
"occ_closing_fee": 0, //position closing fee
"occ_funding_fee": 0, //funding fee
"wallet_balance": 1000, //wallet balance. When in Cross Margin mod, the number minus your unclosed loss is your real wallet balance.
"realised_pnl": 0, //daily realized profit and loss
"unrealised_pnl": 2, //unrealised profit and loss
// when side is sell, unrealised_pnl = size * (1.0 / mark_price - 1.0 / entry_price)
// when side is buy, unrealised_pnl = size * (1.0 / entry_price - 1.0 / mark_price)
"cum_realised_pnl": 0, //total relised profit and loss
"given_cash": 0, //given_cash
"service_cash": 0 //service_cash
}
},
"time_now": "1578284274.816029"
}
Set risk limit
POST
/open-api/wallet/risk-limit
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | symbol |
risk_id | true | integer | risk ID. Can be found with the Get risk limit list endpoint |
{
"ret_code": 0,
"ret_msg": "ok",
"ext_code": "",
"result": {
"position": {
"id": 1,
"user_id": 1,
"symbol": "BTCUSD",
"side": "None",
"size": 0,
"position_value": 0,
"entry_price": 0,
"risk_id": 2,
"auto_add_margin": 0,
"leverage": 1,
"position_margin": 0,
"liq_price": 0,
"bust_price": 0,
"occ_closing_fee": 0,
"occ_funding_fee": 0,
"take_profit": 0,
"stop_loss": 0,
"trailing_stop": 0,
"position_status": "Normal",
"deleverage_indicator": 0,
"oc_calc_data": "{\"blq\":1,\"blv\":\"0.000125\",\"slq\":0,\"bmp\":8000,\"smp\":0,\"fc\":-0.00012529,\"bv2c\":1.00225,\"sv2c\":1.0007575}",
"order_margin": 0.00012529,
"wallet_balance": 1000,
"realised_pnl": 0,
"cum_realised_pnl": 0,
"cum_commission": 0,
"cross_seq": 4376,
"position_seq": 13689,
"created_at": "2019-08-13T06:51:29.000Z",
"updated_at": "2019-12-29T03:11:08.000Z",
"ext_fields": {
"v": 4
}
},
"risk": {
"id": 2,
"coin": "BTC",
"limit": 300,
"maintain_margin": "1.00",
"starting_margin": "1.50",
"section": "[\"1\",\"2\",\"3\",\"5\",\"10\",\"25\",\"50\",\"66\"]",
"is_lowest_risk": 0,
"created_at": "2019-06-26T05:46:45.000Z",
"updated_at": "2019-06-26T05:46:55.000Z"
}
},
"ext_info": null,
"time_now": "1577589068.435439",
"rate_limit_status": 71,
"rate_limit_reset_ms": 1577589068546,
"rate_limit": "75"
}
Get risk limit list
GET
/open-api/wallet/risk-limit/list
parameter | required | type | comments |
---|
{
"ret_code": 0,
"ret_msg": "ok",
"ext_code": "",
"result": [
{
"id": 1,
"coin": "BTC",
"limit": 150,
"maintain_margin": "0.50",
"starting_margin": "1.00",
"section": [
"1",
"2",
"3",
"5",
"10",
"25",
"50",
"100"
],
"is_lowest_risk": 1,
"created_at": "2018-11-09T13:53:04.000Z",
"updated_at": "2018-11-09T13:53:04.000Z"
},
{
"id": 11,
"coin": "ETH",
"limit": 3000,
"maintain_margin": "1.00",
"starting_margin": "2.00",
"section": [
"1",
"2",
"3",
"5",
"15",
"30",
"40",
"50"
],
"is_lowest_risk": 1,
"created_at": "2019-01-25T08:31:54.000Z",
"updated_at": "2019-01-25T08:31:54.000Z"
}
],
"ext_info": null,
"time_now": "1577587907.157396",
"rate_limit_status": 599,
"rate_limit_reset_ms": 1577587907162,
"rate_limit": 600
}
Funding rate is generated every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC. If it's 12:00 UTC now, what you will get is the funding rate generated at 08:00 UTC.
GET
/open-api/funding/prev-funding-rate
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
{
'ret_code':0 // return code (0: successful. -101: Parameters verification failed)
'ret_msg':'ok' // error message
'ext_code':'', // additional error code
'result': {
'symbol':'BTCUSD',
'funding_rate':'0.00375000', // When the funding rate is positive, longs pay shorts. When it is negative, shorts pay longs.
'funding_rate_timestamp':1539950401 // The time of funding rate generation, UTC timestamp
},
'time_now':'1539778407.210858', // UTC timestamp
}
Funding settlement occurs every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC. The current interval's fund fee settlement is based on the previous interval's fund rate. For example, at 16:00, the settlement is based on the fund rate generated at 8:00. The fund rate generated at 16:00 will be used at 0:00 on the next day.
GET
/open-api/funding/prev-funding
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
{
'ret_code':0 // return code (0: successful, -101: Parameters verification failed)
'ret_msg':'ok' // error message
'ext_code':'', // additional error code
'result': {
'symbol':'BTCUSD',
'side': 'Buy', // Your position side at the time of settlement
'size': 10, // Your position size at the time of settlement
'funding_rate':'0.00375000', // Funding rate for settlement. When the funding rate is positive, longs pay shorts. When it is negative, shorts pay longs.
'exec_fee': 0.00000116, // Funding fee.
'exec_timestamp': 1539950401, // The time of funding settlement occurred, UTC timestamp
},
'time_now':'1539778407.210858', // UTC timestamp
'rate_limit_status':10, // The number of remaining calls for this type of API in the current period (1 min).
}
Get predicted funding rate and funding fee
GET
/open-api/funding/predicted-funding
parameter | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
{
'ret_code':0 // return code (0: successful, -101: Parameters verification failed)
'ret_msg':'ok' // error message
'ext_code':'', // additional error code
'result': {
'predicted_funding_rate': 0.001, // predicted funding rate. When the funding rate is positive, longs pay shorts. When it is negative, shorts pay longs.
'predicted_funding_fee': 0.000234 // predicted funding fee
},
'time_now':'1539778407.210858', // UTC timestamp
}
Get user's trade records
GET
/v2/private/execution/list
parameter | required | type | comments |
---|---|---|---|
order_id | false | string | OrderID. If not provided, will return user's trading records |
symbol | false | string | Contract type. If order_id not provided, symbol is required |
start_time | false | int | Start timestamp point for result |
page | false | integer | Page. Default getting first page data |
limit | false | integer | Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page |
{
'ret_code': 0, // return code
'ret_msg': 'OK', // error message
'ext_code': '', // additional error code
'ext_info': '', // additional error info
'result': {
'order_id': '', // always empty
'trade_list': [{
'closed_size': 0, // Closed size
'cross_seq': 3154097, // CrossSeq
'exec_fee': '-0.00000005', // Execution fee
'exec_id': 'b3551383-19b1-4aa6-8ac2-f996bea6e07c', // Unique exec ID
'exec_price': '4202', // Exec Price
'exec_qty': 1, // Exec Qty
'exec_time': '1545203567', // Exec time
'exec_type': 'Trade', // Exec type -- Trade: normal Funding: funding AdlTrade:ADL BustTrade: liquidation trade
'exec_value': '0.00023798', // Exec value
'fee_rate': '-0.00025', // Fee rate
'last_liquidity_ind': 'AddedLiquidity', // AddedLiquidity/RemovedLiquidity
'leaves_qty': 0, // Leave Qty
'nth_fill': 7, // Nth Fill
'order_id': 'd854bb13-3fb9-4608-ade4-828f50210778', // Unique order ID
'order_price': '4202', // Order's price
'order_qty': 1, // Order's qty
'order_type': 'Limit', // Order's type
'side': 'Sell', // Side
'symbol': 'BTCUSD', // Symbol
'user_id': 155446 // UserID
}]
},
'time_now': '1551340186.761136'
}
Get the orderbook
Response is in the snapshot format
GET
/v2/public/orderBook/L2
parameters | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
{
"ret_code": 0, // return code
"ret_msg": "OK", // error message
"ext_code": "", // additional error code
"ext_info": "", // additional error info
"result": [
{
"symbol": "BTCUSD", // symbol
"price": "9487", // price
"size": 336241, // size (in USD contracts)
"side": "Buy" // side
},
{
"symbol": "BTCUSD", // symbol
"price": "9487.5", // price
"size": 522147, // size (in USD contracts)
"side": "Sell" // side
}
],
"time_now": "1567108756.834357" // UTC timestamp
}
Get the latest information for symbol
GET
/v2/public/tickers
parameters | required | type | comments |
---|---|---|---|
symbol | false | string | Contract type |
// other symbols omitted - the normal response will have additional dictionaries within the "result" class detailing the
// different symbols
{
"ret_code": 0, // return code
"ret_msg": "OK", // error message
"ext_code": "", // additional error code
"ext_info": "", // additional error info
"result": [
{
"symbol": "BTCUSD", // instrument name
"bid_price": "9499.5", // the bid price
"ask_price": "9500", // the ask price
"last_price": "9499.50", // the latest price
"last_tick_direction": "ZeroMinusTick", // the direction of last tick:PlusTick,ZeroPlusTick,MinusTick,ZeroMinusTick
"prev_price_24h": "9659.00", // the price of prev 24h
"price_24h_pcnt": "-0.02", // the current last price percentage change from prev 24h price
"high_price_24h": "9737.00", // the highest price of prev 24h
"low_price_24h": "9322.50", // the lowest price of prev 24h
"prev_price_1h": "9469.00", // the price of prev 1h
"price_1h_pcnt": "0.00", // the current last price percentage change from prev 1h price
"mark_price": "9509.24", // mark price
"index_price": "9509.00", // index price
"open_interest": 78923133, // open interest quantity - updates every minute (updates may be more frequent than every 1 minute)
"open_value": "8078.86", // open value quantity - updates every minute (updates may be more frequent than every 1 minute)
"total_turnover": "6540981.84", // total turnover
"turnover_24h": "59236.52", // 24h turnover
"total_volume": 62971273761, // total volume
"volume_24h": 564198332, // 24h volume
"funding_rate": "0.00", // funding rate
"predicted_funding_rate": "-0.00", // predicted funding rate
"next_funding_time": "2019-08-30T00:00:00Z", // next funding time
"countdown_hour": 4 // the rest time to settle funding fee
}
],
"time_now": "1567109419.049271"
}
Get recent trades
GET
/v2/public/trading-records
parameters | required | type | comments |
---|---|---|---|
symbol | true | string | Contract type |
from | false | int | From id. Default returns latest data |
limit | false | int | Number of result. Default 500; max 1000 |
{
"ret_code": 0, // error code 0 means success
"ret_msg": "OK", // error message
"ext_code": "",
"ext_info": "",
"result": [
{
"id":7724919, // ID
"symbol": "BTCUSD", // contract type
"price": 9499.5, // execution price
"qty": 9500, // execution quantity
"side": "Buy", // side
"time": "2019-11-19T08:03:04.077Z", // UTC time
}
],
"time_now": "1567109419.049271"
}
This is a list of valid options (and rules) for the different parameters when sending a request to the API
Buy
Sell
BTCUSD
ETHUSD
EOSUSD
XRPUSD
BTC
ETH
EOS
XRP
Deposit
Withdraw
RealisedPNL
Commission
Refund
Prize
ExchangeOrderWithdraw
ExchangeOrderDeposit
ToBeConfirmed
UnderReview
Pending
- Pending transferSuccess
CancelByUser
Reject
Expire
Limit
Market
- Maximum quantity of 1 million (
1000000
) - Must be an integer - no decimals, only a whole number of USD contracts
40
- allowed30.5
- illegal
- Active order
- Must be an increment of that market's
tick_size
- Use modulo(
%
) to calculate whether or not a price will be accepted, like so:IF price % tick_size = 0 // send request ELSE // do not send request as the price will not be accepted by the system
- Current symbol information (like tick sizes) can be found here: https://api.bybit.com/v2/public/symbols
- Use modulo(
- Must be less than 1 million (
1000000
) - If the user has no open position then the price must be greater than 10% of the market price
- For example, if the current market price (last price) is
10314
, then the absolute minimum the price may be is1031.5
. It may not be1031
or below. - In pseudocode (assuming the price is an increment of 0.5):
IF price > (last_price * 0.1) // send request ELSE // do not send request as the price will not be accepted by the system
- For example, if the current market price (last price) is
- If the user holds a position, the order price must be better than the liquidation price.
- For example, if the liquidation price of an open long position is
5176.5
then the price may be a minimum of5177
. In the case of a short position the price must be less than the liquidation price.
- For example, if the liquidation price of an open long position is
- Must be an increment of that market's
- Conditional order
- Must be equal to order greater than
1
- Must be equal to order greater than
GoodTillCancel
ImmediateOrCancel
FillOrKill
PostOnly
LastPrice
IndexPrice
MarkPrice
Created
New
PartiallyFilled
Filled
Cancelled
Rejected
- NOTE: currently broken for both get conditional order and get active order
- This is for sorting the orders by creation date
desc
(default)asc
- Filter fetched orders by their order statuses
- To filter by multiple statuses, separate with a comma like so:
Filled,New
Created
Rejected
New
PartiallyFilled
Filled
Cancelled
PendingCancel
- The matching engine has received the cancellation but there is no guarantee that it will be successfulDeactivated
- The conditional order was cancelled before triggering
CancelByUser
CancelByReduceOnly
CancelByPrepareLiq
,CancelAllBeforeLiq
- Canceled by force liquidationCancelByPrepareAdl
,CancelAllBeforeAdl
- Canceled by ADLCancelByAdmin
CancelByTpSlTsClear
- Means this is a cancelled TP/SL orderCancelByPzSideCh
- Means this order is cancelled after TP/SL
CreateByUser
CreateByClosing
CreateByAdminClosing
CreateByStopOrder
CreateByTakeProfit
CreateByStopLoss
CreateByTrailingStop
CreateByLiq
- Created by partial liquidationCreateByAdl_PassThrough
- Created by ADLCreateByTakeOver_PassThrough
- Created by liquidation takeover.