Introduction
Welcome to the Binjex API.
REST - Overview
The following sections explain how to use the REST API.
The production API base URL is https://api.binjex.com
Rate Limiting
The following rate limits are applied:
- Public endpoints are limited to 100 requests per second per IP
- Authenticated endpoints are limited to 100 requests per second per customer
HTTP Status Codes
- 200 OK - Successful request
- 400 Bad Request - Returns JSON with error information
- 401 Unauthorized - Authorisation is required or has failed
- 403 Forbidden - Action is forbidden for API key
- 429 Too Many Requests - Your connection has been rate limited
- 500 Internal Server Error
- 503 Service Unavailable - Service is down for maintenance
- 504 Gateway Timeout - Request timed out or expired
Error Response
Errors are returned like this:
{
"error": {
"code": 500,
"message": "Something went wrong"
}
}
Error responses have an error code
and a human readable message
field.
Authentication
To authorize, use this code:
curl -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/account"
Public market data is available without authentication. All account related requests will require authentication.
We use Basic Authentication to access protected endpoints.
You can create API keys in your back office API keys section.
REST - General Endpoints
Test Connectivity
curl -X GET "https://api.binjex.com/api/v1/ping"
The above command returns JSON structured like this:
{}
Test connectivity of the API.
HTTP Request
GET /api/v1/ping
Response
An empty object is returned.
Check Server Time
curl -X GET "https://api.binjex.com/api/v1/time"
The above command returns JSON structured like this:
{
"time": 1591964202399
}
Get the current server time.
HTTP Request
GET /api/v1/time
Response
Name | Type | Description |
---|---|---|
time | Integer | Current server time (ms) |
Exchange Info
curl -X GET "https://api.binjex.com/api/v1/exchange_info"
The above command returns JSON structured like this:
{
"timezone": "UTC",
"timestamp": 0,
"symbols": [{
"symbol": "BTC_USDT",
"base_currency": "BTC",
"quote_currency": "USDT",
"qty_scale": 5,
"qty_inc": "0.00001",
"qty_min": "0",
"qty_max": "0",
"price_scale": 2,
"price_inc": "0.01",
"price_range_multiplier_up": "5",
"price_range_multiplier_down": "0.2",
"notional_min": "0",
"notional_max": "0",
"max_num_orders": 200,
"max_num_algo_orders": 5,
"fee_currency": "USDT",
}],
}
Get the exchange information which includes each symbol available and its configuration.
HTTP Request
GET /api/v1/exchange_info
Response
Name | Type | Description |
---|---|---|
timezone | String | The timezone of the server |
timestamp | Integer | Current server time (ms) |
symbols | List | A list of symbol objects |
A symbol object contains the following properies:
Name | Type | Description |
---|---|---|
symbol | String | Symbol identifier |
base_currency | String | |
quote_currency | String | |
qty_scale | Integer | Maximum decimal places of the qty |
qty_inc | Number | The amount the qty must be divisble by |
qty_min | Number | Minimum accepted qty of an order (0 if disabled) |
qty_max | Number | Maximum accepted qty of an order (0 if disabled) |
price_scale | Integer | Maximum decimal places of the limit/stop price |
price_inc | Number | The amount the limit/stop price must be divisble by |
price_range_multiplier_up | Number | limit/stop price <= last_price * price_range_multiplier_up |
price_range_multiplier_down | Number | limit/stop price >= last_price * price_range_multiplier_down |
notional_min | Number | The minimum order total (price * qty) (0 if disabled) |
notional_max | Number | The maximum order total (price * qty) (0 if disabled) |
max_num_orders | Integer | The maximum number of orders you can have open on the symbol |
max_num_algo_orders | Integer | The maximum number of algo orders you can have open on the symbol. Algo orders also count towards your total order limit. |
fee_currency | String | The currency in which trading fees are deducted. |
REST - Market Data Endpoints
Tickers
curl -X GET "https://api.binjex.com/api/v1/ticker/24hr"
The above command returns JSON structured like this:
[
{
"symbol": "LTCUSD",
"bid": "58.31",
"bid_qty": "0.2134",
"ask": "58.46",
"ask_qty": "0.4312",
"last": "58.32",
"last_qty": "0.1452",
"open": "57.02",
"low": "56.41",
"high": "59.7",
"volume": "44098.80068",
"volume_quote": "2553472.1685399",
"vwap": "57.90",
"count": 3948,
"change": "3.13",
"change_percent": "-1.24",
"first_trade_id": 199622746,
"last_trade_id": 199771651,
"stats_start_time": 1590062534162,
"stats_close_time": 1590148934162,
"bid_liquidity_base": "1691.19238",
"bid_liquidity_quote": "12024253.3504521",
"ask_liquidity_base": "1228.95158",
"ask_liquidity_quote": "14254810.4747735",
},
{
...
}
]
Get high level market stats over a 24 hour rolling window.
HTTP Request
GET /api/v1/ticker/24hr
Parameters
Name | Required | Description |
---|---|---|
symbol | No |
Response
Returns a list of ticker objects.
Name | Type | Description |
---|---|---|
symbol | String | The market the ticker is for |
bid | Number | The best bid price on the order books |
bid_qty | Number | The best bid qty on the order books |
ask | Number | The best ask price on the order books |
ask_qty | Number | The best ask qty on the order books |
last | Number | The last trade price |
last_qty | Number | The last trade qty |
open | Number | The first trade price |
low | Number | The lowest trade price |
high | Number | The highest trade price |
volume | Number | The amount of base currency that was traded |
volume_quote | Number | The amount of quote currency that was traded |
vwap | Number | The volume weighted average price |
change | Number | The amount of the price change |
change_percent | Number | The price change as a percent |
count | Integer | The number of trades made |
first_trade_id | Integer | The first trade ID included in the stats |
last_trade_id | Integer | The last trade ID included in the stats |
stats_start_time | Integer | A unix timestamp (ms) of starting time of the stats |
stats_close_time | Integer | A unix timestamp (ms) of closing time of the stats |
Trades
curl -X GET "https://api.binjex.com/api/v1/trades?symbol=ETH_BTC"
The above command returns JSON structured like this:
[
{
"id": 948324,
"timestamp": 1537279031837,
"side": 0,
"qty": "0.3",
"price": "105.43",
"buy_order_id": 433552363,
"sell_order_id": 433552360,
},
{
...
}
]
Get a list of recent trades for a symbol on the exchange.
HTTP Request
GET /api/v1/trades
Parameters
Name | Required | Description |
---|---|---|
symbol | Yes | |
sort | No | ASC or DESC (default DESC) |
limit | No | Limit the results returned (default 500, max 1000) |
start_from | No | Trade ID to start results from |
Response
Returns a list of trade objects.
Name | Type | Description |
---|---|---|
id | Integer | Unique ID of the trade |
timestamp | Integer | Unix timestamp (ms) of trade |
side | Integer |
0 - buy 1 - sell |
qty | Number | Amount of base currency traded |
price | Number | Price of the trade |
buy_order_id | Integer | |
sell_order_id | Integer |
Price Book
curl -X GET "https://api.binjex.com/api/v1/price_book?symbol=ETH_BTC"
The above command returns JSON structured like this:
{
"last_update_id": 69721230,
"bids": [
["105.12", "0.7361", 2],
["104.83", "0.5736", 3],
],
"asks": [
["106.00", "0.4315", 3],
["107.23", "0.1847", 1],
]
}
Get price book data for a symbol on the exchange.
HTTP Request
GET /api/v1/price_book
Parameters
Name | Required | Description |
---|---|---|
symbol | Yes | |
limit | No | The number of price levels to return. (default 100; valid levels 5, 10, 20, 50, 100, 500, 1000, 5000) |
Response
Returns an object containing lists of bid and ask price book rows.
Name | Type | Description |
---|---|---|
last_update_id | Integer | The last sequential update id of the book |
bids | List | List of bid price book rows |
asks | List | List of ask price book rows |
price book row: [<PRICE>, <QTY>, <COUNT>]
Name | Type | Description |
---|---|---|
<PRICE> | Number | Price level |
<QTY> | Number | The qty available at the price level |
<COUNT> | Integer | The number of orders at the price level |
Candles
curl -X GET "https://api.binjex.com/api/v1/candles?symbol=ETH_BTC&interval=1D"
The above command returns JSON structured like this:
[
{
"start_time": 1537995600000,
"close_time": 1537995600999,
"open": "6497.35",
"close": "6500.92",
"low": "6492.64",
"high": "6508.49",
"volume": "21.356832",
"volume_quote": "138815.98738456",
"count": 221,
"buy_volume": "10.382642",
"buy_volume_quote": "723943.84732284",
"buy_count": 112
},
{
...
}
]
Candle data used for OHLC charting.
HTTP Request
GET /api/v1/candles
Parameters
Name | Required | Description |
---|---|---|
symbol | Yes | |
interval | Yes | 1, 5, 30, 60, 240, 1D, 1W, 1M |
sort | No | ASC or DESC (default DESC) |
limit | No | Limit the results returned (default 500; max 1000) |
start_from | No | Start results from this timestamp (ms) |
Response
Returns a list of candle objects.
Name | Type | Description |
---|---|---|
start_time | Integer | Unix timestamp (ms) of candle start time |
close_time | Integer | Unix timestamp (ms) of candle close time |
open | Number | First trade price |
close | Number | Last trade price |
low | Number | Lowest trade price |
high | Number | Highest trade price |
volume | Number | Amount of base asset traded |
volume_quote | Number | Amount of quote asset traded |
count | Integer | Number of trades |
buy_volume | Number | Amount of base asset traded from buy takers |
buy_volume_quote | Number | Amount of quote asset traded from buy takers |
buy_count | Integer | Number of trades that were buy takers |
REST - Account Endpoints
Account Information
curl -X GET -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/account"
The above command returns JSON structured like this:
{
"taker_fee_rate": "0.002",
"maker_fee_rate": "0.001",
"balances": [{
"currency": "BTC",
"available": "0.01",
"reserve": "0",
}, {
"currency": "ETH",
"available": "0",
"reserve": "1.432",
}]
}
Get account information including trading fees and current balances.
HTTP Request
GET /api/v1/account
Response
Name | Type | Description |
---|---|---|
taker_fee_rate | Number | Fee rate for taker trades |
maker_fee_rate | Number | Fee rate for maker trades |
balances | List | List of balance objects. |
Balance objects have the following fields:
Name | Type | Description |
---|---|---|
currency | String | The currency of the balance |
available | Number | Available balance |
reserve | Number | Amount reserved for open orders |
Order Object
JSON format of Order Object:
{
"id": 812916196,
"symbol": "ETHBTC",
"type": 1,
"side": 0,
"status": 5,
"time_in_force": 1,
"price": "0.018366",
"stop_price": null,
"qty": "0.01",
"qty_filled": "0.01",
"quote_volume": "0.00018365",
"quote_fee": "0.0000003673",
"created_at": 1566999287000,
"updated_at": 1566999287000,
}
Name | Type | Description |
---|---|---|
id | Integer | Unique identifier for the order |
symbol | String | Symbol of the order |
type | Integer |
1 - limit 2 - market 3 - stop 4 - stop limit |
side | Integer |
0 - buy 1 - sell |
status | Integer |
0 - pending 1 - active 2 - cancelled 4 - partially filled 5 - filled 6 - triggered |
time_in_force | Integer |
0 - IOC 1 - GTC |
price | Number | The limit price of the order. |
stop_price | Number | The trigger price for stop orders. |
qty | Number | The total qty wanting to be filled. |
qty_filled | Number | The amount of the base currency that was filled. |
quote_volume | Number | The amount of the quote currency that was filled. |
quote_fee | Number | The amount of the fees paid on the order. |
created_at | Integer | The unix timestamp (MS) the order was created. |
updated_at | Integer | The unix timestamp (MS) the order was updated. |
Order Fill Object
JSON format of Order Fill Object:
{
"id": 170657672,
"order_id": 812916196,
"trade_id": 118849458,
"symbol": "ETHBTC",
"timestamp": 1566999287000,
"side": 0,
"qty": "0.01",
"price": "0.018365",
"quote_qty": "0.00018365",
"fee": "0.0000003673",
"fee_currency": "BTC",
"is_maker": 0,
}
Name | Type | Description |
---|---|---|
symbol | String | Symbol of the trade |
id | Integer | Unique identifier for the order fill |
trade_id | Integer | Unique identifier for the trade |
order_id | Integer | Unique identifier for the order |
side | Integer | 0 - buy 1 - sell |
qty | Number | Base quantity traded |
price | Number | Trade price |
quote_qty | Number | Quote quantity traded (qty * price) |
fee | Number | Trade commission. If negative, fee is a reward. |
fee_currency | String | The currency of the fee |
timestamp | Integer | Trade timestamp (MS) |
is_maker | Integer |
0 - taker 1 - maker |
Create Order
curl -X POST -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/create_order" \
-d "symbol=ETHBTC&type=1&side=0&qty=0.25&price=0.018336"
The above command returns an Order Object
Create a new order on the exchange.
HTTP Request
POST /api/v1/create_order
Parameters
Name | Description |
---|---|
symbol | Symbol of exchange to create order on |
type |
1 - limit 2 - market 4 - stop limit |
side |
0 - buy 1 - sell |
time_in_force |
0 - IOC 1 - GTC |
qty | The amount of base currency |
price | The limit price of the order |
stop_price | The stop price of the order |
IOC - Immediate Or Cancel
The order fills as much as it can instantly and any remaining amount is cancelled. This is the default for market type orders.
GTC - Good Til Cancelled
The order will remain open until it is completed or cancelled. This is the default for limit type orders and is only available for limit type order.
Response
Returns an order object.
Cancel Order
curl -X POST -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/cancel_order" \
-d "order_id=812916196"
The above command returns an Order Object
Cancel an active order by order ID.
HTTP Request
POST /api/v1/cancel_order
Parameters
Name | Required | Description |
---|---|---|
order_id | Yes | The unique identifier of the order you want to cancel |
Response
Returns an order object.
Cancel All Orders
curl -X POST -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/cancel_all_orders"
The above command returns JSON structured like this:
{
"success": [83746321, 83746327],
"errors": [83746314],
}
Cancel all active orders.
HTTP Request
POST /api/v1/cancel_all_orders
Parameters
Name | Required | Description |
---|---|---|
symbol | No | Only cancel orders from the specified symbol |
Response
Returns a JSON structure with a list of order IDs that were successfully cancelled and a list of order IDs that failed cancellation.
Query Order
curl -X GET -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/get_order?order_id=812916196"
The above command returns an Order Object
Get an order by its ID.
HTTP Request
GET /api/v1/get_order
Parameters
Name | Required | Description |
---|---|---|
order_id | Yes | Unique order identifier |
Response
Returns an order object.
Query Active Orders
curl -X GET -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/active_orders"
The above command returns a list of Order Objects
Get a list of orders that are currently active.
HTTP Request
GET /api/v1/active_orders
Parameters
Name | Required | Description |
---|---|---|
symbol | No | Filter orders by symbol |
Response
Returns a list of active order objects.
Query Order History
curl -X GET -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/order_history?limit=10"
The above command returns a list of Order Objects
Get a list of orders that are no longer active.
NOTE: Cancelled orders with no qty filled are deleted after 24 hours.
HTTP Request
GET /api/v1/order_history
Parameters
Name | Required | Description |
---|---|---|
symbol | No | Filter orders by symbol |
sort | No | ASC or DESC (default DESC) |
limit | No | Limit results (default 500; max 1000) |
start_from | No | Start results from this order id |
Response
Returns a list of order objects.
Query Trade History
curl -X GET -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/trade_history?limit=10"
The above command returns JSON structured like this:
[
{
"id": 170657672,
"order_id": 812916196,
"trade_id": 118849458,
"symbol": "ETHBTC",
"timestamp": 1566999287000,
"side": 0,
"qty": "0.01",
"price": "0.018365",
"quote_qty": "0.00018365",
"fee": "0.0000003673",
"fee_currency": "BTC",
"is_maker": 0,
}
]
Get a list of trades made in your account.
HTTP Request
GET /api/v1/trade_history
Parameters
Name | Required | Description |
---|---|---|
symbol | No | Filter orders by symbol |
sort | No | ASC or DESC (default DESC) |
limit | No | Limit results (default 500; max 1000) |
start_from | No | Start results from this order fill id |
Response
Returns a list of order fill objects.
Query Trades By Order
curl -X GET -u "API_KEY:API_SECRET" \
"https://api.binjex.com/api/v1/trades_by_order"
The above command returns JSON structured like this:
[
{
"id": 170657672,
"order_id": 812916196,
"trade_id": 118849458,
"symbol": "ETHBTC",
"timestamp": 1566999287000,
"side": 0,
"qty": "0.01",
"price": "0.018365",
"quote_qty": "0.00018365",
"fee": "0.0000003673",
"fee_currency": "BTC",
"is_maker": 0,
}
]
Get a list of trades in your account by an order ID.
HTTP Request
GET /api/v1/trades_by_order
Parameters
Name | Required | Description |
---|---|---|
order_id | Yes | The order id to find trades linked to |
Response
Returns a list of order fill objects.
Websocket - Overview
The following sections explain how to use the Websocket stream.
The production websocket URL is wss://ws.binjex.com/ws
WS - Subscribe
Payload:
{
"event": "subscribe",
"data": {
"id": 1,
"channels": [
"BTC_USD@trade",
]
}
}
Response:
{
"channel": "",
"event": "subscribed",
"data": {
"id": 1,
"channels": [
"BTC_USD@trade",
],
}
}
Subscribe to one or more channels to start receiving stream events.
WS - Unsubscribe
Payload:
{
"event": "unsubscribe",
"data": {
"id": 1,
"channels": [
"BTC_USD@trade",
]
}
}
Response:
{
"channel": "",
"event": "unsubscribed",
"data": {
"id": 1,
"channels": [
"BTC_USD@trade",
],
}
}
Unubscribe from one or more channels to stop receiving stream events.
WS - List Subscriptions
Payload:
{
"event": "list_subscriptions",
"data": {
"id": 1,
}
}
Response:
{
"channel": "",
"event": "list_subscriptions",
"data": {
"id": 1,
"channels": [
"BTC_USD@trade",
],
}
}
List the current channels you are subscribed to.
WS - Authentication
Authenticate:
{
"event": "auth",
"data": {
"api_key": "API_KEY",
"api_secret": "API_SECRET",
}
}
Unauthenticate:
{
"event": "unauth",
}
Authenticate to start receiving user stream events. You will need your API Key and API Secret.
Websocket - Market Stream
WS - Trades
Payload:
{
"channel": "BTC_USD@trade",
"event": "trade",
"data": {
"e": "trade", // event name
"E": 0, // event timestamp (ms)
"s": "BTC_USD", // symbol
"i": 0, // trade id
"b": true, // is taker buy
"p": "9454.24", // price
"q": "0.4224", // qty
"t": 0, // trade timestamp (ms)
"o": 0, // buy order id
"O": 0, // sell order id
}
}
Trades for a specific symbol.
Channel: <SYMBOL>@trade
Update Speed: Real-time
WS - Ticker
Payload:
{
"channel": "BTC_USD@ticker",
"event": "update",
"data": {
"e": "update", // event name
"E": 0, // event timestamp (ms)
"s": "BTC_USD", // symbol
"p": "0", // change amount
"P": "0", // change percent
"v": "0", // base volume
"q": "0", // quote volume
"n": 0, // number of trades
"b": "0", // best bid price
"B": "0", // best bid qty
"a": "0", // best ask price
"A": "0", // best ask qty
"o": "0", // open
"h": "0", // high
"l": "0", // low
"c": "0", // last trade price
"Q": "0", // last trade qty
"w": "0", // weighted average price
"f": 0, // first trade id
"L": 0, // last trade id
"t": 0, // stats start timestamp (ms)
"T": 0, // stats close timestamp (ms)
"blq": "0", // bid liquidity base qty
"blQ": "0", // bid liquidity quote qty
"alq": "0", // ask liquidity base qty
"alQ": "0", // ask liquidity quote qty
}
}
24 hour rolling ticker statistics for a single symbol.
Channel: <SYMBOL>@ticker
Update Speed: 1000ms
WS - All Tickers
Payload:
{
"channel": "ticker",
"event": "update",
"data": [
// same format as ticker.data,
]
}
24 hour rolling ticker statistics for all symbols. Only tickers that have been changed will be included in the data.
Channel: ticker
Update Speed: 1000ms
WS - Candlestick
Payload:
{
"channel": "BTC_USD@candle:1D",
"event": "candle",
"data": {
"e": "candle", // event name
"E": 0, // event time (ms)
"s": "BTC_USD", // symbol
"i": "1D", // interval
"t": 0, // candle start time (ms)
"T": 0, // candle close time (ms)
"o": "0", // open
"h": "0", // high
"l": "0", // low
"c": "0", // close
"v": "0", // base volume
"q": "0", // quote volume
"n": 0, // number of trades
"V": "0", // base volume for buy takers
"Q": "0", // quote volume for buy takers
"N": "0", // number of trades for buy takers
"f": 0, // first trade id
"L": 0, // last trade id
"x": false, // is the candle closed
}
}
Updates to the current candle stick data every second.
Intervals: 1, 5, 30, 60, 240, 1D, 1W, 1M
Channel: <SYMBOL>@candle:<INTERVAL>
Update Speed: 1000ms
WS - Book Ticker
Payload:
{
"channel": "BTC_USD@book_ticker",
"event": "update",
"data": {
"u": 0, // order book update id
"s": "BTC_USD", // symbol
"b": "0", // best bid price
"B": "0", // best bid qty
"a": "0", // best ask price
"A": "0", // best ask qty
}
}
Updates to the best bid or ask's price or quantity in realtime for a specific symbol.
Channel: <SYMBOL>@book_ticker
Update Speed: Real-time
WS - All Book Tickers
Payload:
{
"channel": "book_ticker",
"event": "update",
"data": [
// same format as book_ticker.data
]
}
Updates to the best bid or ask's price or quantity in realtime for all symbols.
Channel: book_ticker
Update Speed: Real-time
WS - Partial Book Depth
Payload:
{
"channel": "BTC_USD@book_top:5",
"event": "update",
"data": {
"u": 0, // last update id
"b": [ // bid levels
[
"9461.12", // bid price
"0.3213" // bid qty
]
],
"a": [ // ask levels
[
"9484.25", // ask price
"0.5214", // ask qty
]
]
}
}
Top <levels> bids and asks pushed every second for a specific symbol.
Levels: 5, 10, 20
Channel: <SYMBOL>@book_top:<LEVEL> or <SYMBOL>@book_top:<LEVEL>:100ms
Update Speed: 1000ms or 100ms
WS - Diff Book Depth
Payload:
{
"channel": "BTC_USD@book_diff",
"event": "update",
"data": {
"e": "update", // event type
"E": 0, // event time (ms)
"s": "BTC_USD", // symbol
"U": 0, // first update id
"u": 0, // last update id
"b": [ // bids to be updated
[
"9461.12", // price level to be updated
"0.3213" // qty
]
],
"a": [
[
"9484.25", // price level to be updated
"0.5214", // qty
]
]
}
}
Order book price and quantity updates used to manage a local order book.
Channel: <SYMBOL>@book_diff or <SYMBOL>@book_diff:100ms
Update Speed: 1000ms or 100ms
How to correctly manage a local order book:
- Open a websocket connection to the server and subscribe to the diff book depth channel.
- Buffer any events you receive from the channel.
- Get a book snapshot from
/api/v1/price_book?symbol=BTC_USDT&limit=1000
. - Drop any eveny where
u
is <=last_update_id
in the snapshot. - The first processed event should have
U
is <=last_update_id
+1 ANDu
>=last_update_id
+1. - While listening to the stream, each new event's
U
should be = to the previous event'su
+1. - The data in each event is the absolute quantity for a price level.
- If the quantity is 0, remove the price level.
- Receiving an event that removes a price level that is not in your local order book can happen and is normal.
Websocket - User Stream
WS - Execution Report
Payload:
{
"channel": "user_stream",
"event": "execution_report",
"data": {
"e": "execution_report", // event name
"E": 0, // event timestamp (ms)
"s": "BTC_USD", // symbol
"X": "TRADE", // execution report type
"i": 0, // order id
"O": 0, // order creation timestamp (ms) **
"x": 0, // current order status
"S": 0, // side (0=buy, 1=sell)
"o": 1, // order type (1=limit, 2=market)
"q": "0.00", // total order qty
"z": "0.00", // cumulative qty filled
"Z": "0.00", // cuml quote asset filled **
"Q": "0.00", // total quote qty **
"p": "0.00", // limit price
"P": "0.00", // stop price
"F": 0, // order fill id
"L": "0.00", // trade price
"l": "0.00", // trade qty
"t": 0, // trade id
"T": 0, // transaction timestamp (ms)
"m": true, // is trade maker
"Y": "0.00", // quote qty traded (qty * price)
"f": "0.00", // trade fee
"c": "USD", // trade fee currency
}
}
An execution report is emitted each time an order is created or updated.
Update Speed: Real-time
Execution Types:
- NEW
- CANCELLED
- TRIGGERED
- TRADE
- EXPIRED
WS - Execution Balance
Payload:
{
"channel": "user_stream",
"event": "execution_balance",
"data": {
"e": "execution_balance", // event name
"E": 0, // event timestamp (ms)
"B": [{ // list of balances
"c": "BTC", // currency
"a": "0.00", // available
"r": "0.00", // reserve
}, {
"c": "USD",
"a": "0.00",
"r": "0.00",
}]
}
}
This event is sent after an execution_report and contains the balances of currencies that may have been changed.
Update Speed: Real-time
WS - Balance Update
Payload:
{
"channel": "user_stream",
"event": "balance_update",
"data": {
"e": "balance_update", // event name
"E": 0, // event timestamp (ms)
"c": "USD", // currency
"a": "0.00", // available
"r": "0.00", // reserve
}
}
This event is sent everytime a balance is updated outside of orders/trading. This included deposits, withdrawals, commission and other misc credits/debits.
Update Speed: Real-time
WS - Trading Fee Update
Payload:
{
"channel": "user_stream",
"event": "trading_fee_update",
"data": {
"e": "trading_fee_update", // event name
"E": 0, // event timestamp (ms)
"m": "0.001", // maker rate
"t": "0.002", // taker rate
}
}
This event is sent when your trading fee rates may have been updated.
Update Speed: Real-time