NAV

Public Rest API for WazirX

Introduction

This document details the use of Wazirx’s REST API for spot exchange. This helps you automate trades in real-time, stream live crypto rates and build other integrations for your trading journey.

Our REST API is organized into publicly accessible endpoints (market data, exchange status, etc.), and private authenticated endpoints (trading, funding, user data) which require requests to be signed.

API Key Setup

API Key Restrictions

Spot Account

A SPOT account is provided by default upon creation of a WazirX Account.

Python connector

This is a lightweight library that works as a connector to WazirX public API, written in Python. - Python connector

Ruby connector

This is a lightweight library that works as a connector to WazirX public API, written in Ruby. - Ruby connector

Postman Collections

There is now a Postman collection containing the API endpoints for quick and easy use. This is recommended for new users who want to get a quick-start into using the API. For more information please refer to this page: WazirX API Postman

Contact Us

API third party Integrations

These integrations will help you in increasing your speed to build bots

General API Information

HTTP Return Codes

Error Codes and Messages

Sample Payload below:

{
  "code": -1121,
  "message": "Invalid symbol."
}

General Information on Endpoints

Limits

General Info on Limits

IP Limits

Websocket Limits

Endpoint security type

Security Type Description
NONE Endpoint can be accessed freely.
TRADE Endpoint requires sending a valid API-Key and signature.
USER_DATA Endpoint requires sending a valid API-Key and signature.
MARKET_DATA Endpoint requires sending a valid API-Key.

SIGNED (TRADE and USER_DATA) Endpoint security

Timing security

The logic is as follows:

  if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) {
    // process request
  } else {
    // reject request
  }

Serious trading is about timing. Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With recvWindow, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server.

It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!

SIGNED Endpoint Examples for POST /sapi/v1/order

Here is a step-by-step example of how to send a vaild signed payload from the Linux command line using echo, openssl, and curl.

Key Value
apiKey vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A
secretKey NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j
Parameter Value
symbol ltcbtc
side buy
type limit
quantity 1
price 0.1
recvWindow 5000
timestamp 1499827319559

Example 1: As a request body

Request Body:

symbol=ltcbtc&side=buy&type=limit&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559

HMAC SHA256 signature:

[linux]$ echo -n "symbol=ltcbtc&side=buy&type=limit&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "Nh***0j"
(stdin)= a0***60

(HMAC SHA256)

[linux]$ curl -H "X-API-KEY: vm***8A" -X POST 'https://api.wazirx.com/sapi/v1/order' -d 'symbol=ltcbtc&side=buy&type=limit&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=a0***60'

Example 2: As a query string

Query String:

symbol=ltcbtc&side=buy&type=limit&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559

HMAC SHA256 signature:

[linux]$ echo -n "symbol=ltcbtc&side=buy&type=limit&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "Nh***0j"
(stdin)= a0***60

Curl Command:

[linux]$ curl -H "X-API-KEY: vm***8A" -X POST 'https://api.wazirx.com/sapi/v1/order?symbol=ltcbtc&side=buy&type=limit&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=a0***60'

Public API Endpoints

ENUM definitions

Order status (status):

Order types (orderTypes, type):

Order side (side):

General endpoints

Test connectivity

GET /sapi/v1/ping
curl --location --request GET 'https://api.wazirx.com/sapi/v1/ping'

Response:

{}

Test connectivity to the Rest API.

Rate limit: 1 per second

Query Parameters: NONE



System status

GET /sapi/v1/systemStatus
curl --location --request GET 'https://api.wazirx.com/sapi/v1/systemStatus'

Response:

{
    "status": "normal",  // normal or system maintenance
    "message": "System is running normally."
}

Fetch system status.

Rate limit: 1 per second

Query Parameters: NONE






Check server time

GET /sapi/v1/time
curl --location --request GET 'https://api.wazirx.com/sapi/v1/time'

Response:

{
  "serverTime": 1499827319559
}

Test connectivity to the Rest API and get the current server time.

Rate limit: 1 per second

Query Parameters: NONE






Exchange Info

GET /sapi/v1/exchangeInfo
curl --location --request GET 'https://api.wazirx.com/sapi/v1/exchangeInfo'

Response:

{
  "timezone": "UTC",
    "serverTime": 1631531599247,
    "symbols": [
        {
            "symbol": "btcinr",
            "status": "trading",
            "baseAsset": "btc",
            "quoteAsset": "inr",
            "baseAssetPrecision": 5,
            "quoteAssetPrecision": 0,
            "orderTypes": [
                "limit",
                "stop_limit"
            ],
            "isSpotTradingAllowed": true,
            "filters": [
                {
                    "filterType": "PRICE_FILTER",
                    "minPrice": "1",
                    "tickSize": "1"
                }
            ]
        }
      ]
}

Fetch all exchange information

Rate limit: 1 per second

Query Parameters: NONE

Market Data endpoints

24hr tickers price change statistics

GET /sapi/v1/tickers/24hr
curl --location --request GET 'https://api.wazirx.com/sapi/v1/tickers/24hr'

Response:

[
  {
    "symbol": "btcinr",
    "baseAsset": "btc",
    "quoteAsset": "inr",
    "openPrice": "704999.0",
    "lowPrice": "702603.0",    
    "highPrice": "730001.0",
    "lastPrice": "720101.0",
    "volume": "891.8329",
    "bidPrice": "720102.0",
    "askPrice": "722999.0",
    "at": 1588829734
  }
]

24 hour rolling window price change statistics.

Rate limit: 1 per second

24hr ticker price change statistics

GET /sapi/v1/ticker/24hr
curl --location --request GET 'https://api.wazirx.com/sapi/v1/ticker/24hr?symbol=wrxinr'

Response:

{
  "symbol": "wrxinr",
  "baseAsset": "wrx",
  "quoteAsset": "inr",
  "openPrice": "704999.0",
  "lowPrice": "702603.0",    
  "highPrice": "730001.0",
  "lastPrice": "720101.0",
  "volume": "891.8329",
  "bidPrice": "720102.0",
  "askPrice": "722999.0",
  "at": 1588829734
}

24 hour rolling window price change statistics.

Rate limit: 1 per second

Query Parameters:

Name Type Mandatory Description
symbol STRING YES

Kline/Candlestick Data

GET /sapi/v1/klines
curl --location --request GET 'https://api.wazirx.com/sapi/v1/klines?symbol=btcinr&limit=5&interval=1m&startTime=1647822960&endTime=1647823020'

Response:

[
    [
        1647822960,
        20,
        20,
        20,
        20,
        0
    ],
    [
        1647823020,
        20,
        20,
        20,
        20,
        0
    ]
]

Request via this endpoint to get the klines data of the specified symbol.

Rate limit: 1 per second

Query Parameters:

Name Type Mandatory Description
symbol STRING YES
limit STRING NO default 500, max 2000
interval STRING NO allowed values [1m,5m,15m,30m,1h,2h,4h,6h,12h,1d,1w]
startTime LONG NO
endTime LONG NO

Order book

GET /sapi/v1/depth
curl --location --request GET 'https://api.wazirx.com/sapi/v1/depth?symbol=wrxinr&limit=5'

Response:

{
   "lastUpdateAt": 1588831243,
   "asks":[
      [
         "9291.0",   // PRICE
         "0.0119"    // QTY
      ]
   ],
   "bids":[
      [
         "9253.0",   // PRICE
         "1.0456"    // QTY
      ]
   ]
}

Rate limit: 1 per second

Query Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 20; max 1000. Valid limits:[1, 5, 10, 20, 50, 100, 500, 1000]


Recent trades list

GET /sapi/v1/trades
curl --location --request GET 'https://api.wazirx.com/sapi/v1/trades?symbol=wrxinr&limit=10'

Response:

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "48.000012",
    "time": 1499865549590,
    "isBuyerMaker": true
  }
]

Get recent trades.

Rate limit: 1 per second

Query Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 500; max 1000.


Old trade lookup (MARKET_DATA)

GET /sapi/v1/historicalTrades
curl --location --request GET 'https://api.wazirx.com/sapi/v1/historicalTrades?limit=10&symbol=wrxinr&signature=e0***cb&recvWindow=10000&timestamp=1632376801204' \
--header 'X-Api-Key: Ry***n0'

Response:

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "48.000012",
    "time": 1499865549590,
    "isBuyerMaker": true
  }
]

Get older trades.

Rate limit: 1 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Query Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 500; max 1000.
fromId LONG NO TradeId to fetch from. Default gets most recent trades.

Trading Endpoints

New order (TRADE)

POST /sapi/v1/order (HMAC SHA256)
curl --location --request POST 'https://api.wazirx.com/sapi/v1/order' \
--header 'X-Api-Key: Ry***n0' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'symbol=wrxinr' \
--data-urlencode 'side=buy' \
--data-urlencode 'type=limit' \
--data-urlencode 'price=500' \
--data-urlencode 'quantity=1' \
--data-urlencode 'recvWindow=10000' \
--data-urlencode 'timestamp=1632376923837' \
--data-urlencode 'signature=11***6f' \
--data-urlencode 'clientOrderId=clientOrderIdSampl12'

Response:

{
  "id": 28,
  "clientOrderId":"clientOrderIdSampl12",
  "symbol": "wrxinr",
  "price": "9293.0",
  "origQty": "10.0",
  "executedQty": "8.2",
  "status": "wait",
  "type": "limit",
  "side": "sell",
  "createdTime": 1499827319559,
  "updatedTime": 1499827319559
}

Send in a new order.

Rate limit: 10 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Body Parameters:

Name Type Mandatory Description
symbol STRING YES
side ENUM YES
type ENUM YES limit or stop_limit
quantity DECIMAL NO
price DECIMAL NO
stopPrice DECIMAL NO
clientOrderId STRING NO A unique id among open orders. Automatically generated if not sent.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES

Additional mandatory parameters based on type:

Type Additional mandatory parameters
limit quantity, price
stop_limit quantity, price, stopPrice

Test new order (TRADE)

POST /sapi/v1/order/test (HMAC SHA256)
curl --location --request POST 'https://api.wazirx.com/sapi/v1/order/test' \
--header 'X-Api-Key: Ry***n0' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'symbol=wrxinr' \
--data-urlencode 'side=buy' \
--data-urlencode 'type=limit' \
--data-urlencode 'price=500' \
--data-urlencode 'quantity=1' \
--data-urlencode 'recvWindow=10000' \
--data-urlencode 'timestamp=1632376923837' \
--data-urlencode 'signature=11***6f'

Response:

{}

Test new order creation and signature/recvWindow long. Validates a new order but does not send it into the matching engine.

Rate limit: 2 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Body Parameters: Same as POST /sapi/v1/order

Query order (USER_DATA)

GET /sapi/v1/order (HMAC SHA256)
curl --location --request GET 'https://api.wazirx.com/sapi/v1/order/?orderId=1234&clientOrderId=clientOrderIdSampl12&recvWindow=20000&timestamp=1632377057552&signature=91***f0' \
--header 'X-Api-Key: Ry***n0'

Response:

{
  "id": 30,
  "clientOrderId":"clientOrderIdSampl12",
  "symbol": "wrxinr",
  "price": "9293.0",
  "stopPrice": "9200.0",
  "origQty": "10.0",
  "executedQty": "0.0",
  "status": "idle",
  "type": "stop_limit",
  "side": "sell",
  "createdTime": 1499827319559,
  "updatedTime": 1507725176595
}

Check an order's status.

Rate limit: 2 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Query Parameters:

Name Type Mandatory Description
orderId LONG NO
clientOrderId STRING NO A unique clientOrderId among open orders.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES


Current open orders (USER_DATA)

GET /sapi/v1/openOrders  (HMAC SHA256)
curl --location --request GET 'https://api.wazirx.com/sapi/v1/openOrders?symbol=wrxinr&limit=2&recvWindow=20000&timestamp=1632377102391&signature=a1***af' \
--header 'X-Api-Key: Ry***n0'

Response:

[
  {
    "id": 28,
    "clientOrderId":"clientOrderIdSampl12",
    "symbol": "wrxinr",
    "price": "9293.0",
    "origQty": "10.0",
    "executedQty": "8.2",
    "status": "wait",
    "type": "limit",
    "side": "sell",
    "createdTime": 1499827319559,
    "updatedTime": 1499827319559
  },
  {
    "id": 30,
    "clientOrderId":"clientOrderIdSampl123",
    "symbol": "btcusdt",
    "price": "9293.0",
    "stopPrice": "9200.0",
    "origQty": "10.0",
    "executedQty": "0.0",
    "status": "idle",
    "type": "stop_limit",
    "side": "sell",
    "createdTime": 1499827319559,
    "updatedTime": 1507725176595
  }
]

Get all open orders on a symbol.

Rate limit: 1 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Query Parameters:

Name Type Mandatory Description
symbol STRING NO
orderId LONG NO
startTime LONG NO Fetch orders after this time
endTime LONG NO Fetch orders before this time
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES

Notes:


All orders (USER_DATA)

GET /sapi/v1/allOrders (HMAC SHA256)
curl --location --request GET 'https://api.wazirx.com/uapi/v1/allOrders?symbol=wrxinr&orderId=1234&startTime=1590148051000&endTime=1590148051000&limit=100&recvWindow=20000&timestamp=1632377355091&signature=Ot***' \
--header 'X-Api-Key: Ry***n0'

Response:

[
  {
    "id": 28,
    "clientOrderId":"clientOrderIdSampl12",
    "symbol": "wrxinr",
    "price": "9293.0",
    "origQty": "10.0",
    "executedQty": "8.2",
    "status": "cancel",
    "type": "limit",
    "side": "sell",
    "createdTime": 1499827319559,
    "updatedTime": 1499827319559
  },
  {
    "id": 30,
    "clientOrderId":"clientOrderIdSampl12",
    "symbol": "wrxinr",
    "price": "9293.0",
    "stopPrice": "9200.0",
    "origQty": "10.0",
    "executedQty": "0.0",
    "status": "cancel",
    "type": "stop_limit",
    "side": "sell",
    "createdTime": 1499827319559,
    "updatedTime": 1507725176595
  }
]

Get all account orders; "idle", "wait", "cancel" or "done".

Rate limit: 1 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Query Parameters:

Name Type Mandatory Description
symbol STRING YES
orderId LONG NO
startTime LONG NO Fetch order after this time
endTime LONG NO Fetch order before this time
limit INT NO Default 500; max 1000.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES

Notes:


Cancel order (TRADE)

DELETE /sapi/v1/order  (HMAC SHA256)
curl --location --request DELETE 'https://api.wazirx.com/sapi/v1/order' \
--header 'X-Api-Key: Ry***n0' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'symbol=wrxinr' \
--data-urlencode 'orderId=1234' \
--data-urlencode 'clientOrderId=clientOrderIdSampl12' \
--data-urlencode 'recvWindow=20000' \
--data-urlencode 'timestamp=1632377448564' \
--data-urlencode 'signature=c2***17'

Response:

{
  "id": 30,
  "clientOrderId":"clientOrderIdSampl12",
  "symbol": "wrxinr",
  "price": "9293.0",
  "stopPrice": "9200.0",
  "origQty": "10.0",
  "executedQty": "0.0",
  "status": "cancel",
  "type": "stop_limit",
  "side": "sell",
  "createdTime": 1499827319559,
  "updatedTime": 1507725176595
}

Cancel an active order.

Rate limit: 10 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Body Parameters:

Name Type Mandatory Description
symbol STRING YES
orderId LONG NO
clientOrderId STRING NO A unique clientOrderId among open orders.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES


Cancel All Open Orders on a Symbol (TRADE)

DELETE /sapi/v1/openOrders (HMAC SHA256)
curl --location --request DELETE 'https://api.wazirx.com/sapi/v1/openOrders' \
--header 'X-Api-Key: Ry***n0' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'symbol=wrxinr' \
--data-urlencode 'recvWindow=20000' \
--data-urlencode 'timestamp=1632377515580' \
--data-urlencode 'signature=5f***5e'

Response:

[
  {
      "id": 28,
      "clientOrderId":"clientOrderIdSampl12",
      "symbol": "btcusdt",
      "price": "9293.0",
      "origQty": "10.0",
      "executedQty": "8.2",
      "status": "cancel",
      "type": "limit",
      "side": "sell",
      "createdTime": 1499827319559,
      "updatedTime": 1499827319559
    },
    {
      "id": 30,
      "clientOrderId":"clientOrderIdSampl12",
      "symbol": "btcusdt",
      "price": "9293.0",
      "stopPrice": "9200.0",
      "origQty": "10.0",
      "executedQty": "0.0",
      "status": "cancel",
      "type": "stop_limit",
      "side": "sell",
      "createdTime": 1499827319559,
      "updatedTime": 1507725176595
    }
]

Cancels all active orders on a symbol.

Rate limit: 1 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Body Parameters:

Name Type Mandatory Description
symbol STRING YES
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES


My Trades (TRADE)

GET sapi/v1/myTrades
curl --location --request GET 'https://api.wazirx.com/sapi/v1/myTrades?limit=10&symbol=wrxinrt&signature=5f***5e&orderId=22394630&recvWindow=10000&timestamp=1632377515580' \
--header 'X-Api-Key: Ry***n0'

Response:

[
  {
      "id": 22394630,
      "symbol": "wrxinr",
      "fee": "32.40551116",
      "feeCurrency": "inr",
      "quoteQty": "16202.75558",
      "price": "22.0",
      "qty": "736.48889",
      "orderId": 22394630,
      "side": "buy",
      "isBuyerMaker": true,
      "time": 1634898186000
  }
]

Get trades for a specific orderId and symbol.

Rate limit: 2 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Query Parameters:

Name Type Mandatory Description
symbol STRING NO
orderId LONG NO Fetch all trades for a given orderId
fromId LONG NO Fetch all trades after a given tradeId including the given tradeId
limit INT NO Default 500; max 1000.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES
startTime LONG NO Fetch trades after this time
endTime LONG NO Fetch trades before this time

Account Endpoints

Account information (USER_DATA)

GET /sapi/v1/account (HMAC SHA256)
curl --location --request GET 'https://api.wazirx.com/sapi/v1/account?recvWindow=20000&timestamp=1632377552095&signature=3c***e5' \
--header 'X-Api-Key: Ry***n0'

Response:

{
  "accountType": "default",
  "canTrade": true,
  "canWithdraw": true,
  "updateTime": 123456789
}

Get current account information.

Rate limit: 1 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Query Parameters:

Name Type Mandatory Description
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES


Fund details (USER_DATA)

GET /sapi/v1/funds (HMAC SHA256)
curl --location --request GET 'https://api.wazirx.com/sapi/v1/funds?recvWindow=20000&timestamp=1632377552095&signature=3c***e5' \
--header 'X-Api-Key: Ry***n0'

Response:

[
  {
    "asset": "btc",
    "free": "4723846.89208129",
    "locked": "0.0"
  },
  {
    "asset": "wrx",
    "free": "4763368.68006011",
    "locked": "0.0",
    "reservedFee": "12.5"
  }
]

Get fund details for current account.

Rate limit: 1 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Query Parameters:

Name Type Mandatory Description
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES

Websocket Auth Tokens

Create Auth Token

POST /sapi/v1/create_auth_token (HMAC SHA256)
curl --location --request POST 'https://api.wazirx.com/sapi/v1/create_auth_token?recvWindow=20000&timestamp=1632377552095&signature=3c***e5' \
--header 'X-Api-Key: Ry***n0'

Response:

{
    "auth_key": "Xx***dM",
    "timeout_duration": 900
}

Create your auth token for subscription to private socket streams. The stream will close after 30 minutes unless a ping event is sent. If the account has an active auth_key, the api will return the same auth_key and its validity will be extended for another 30 minutes.

Rate limit: 1 per second

Headers:

Name Type Mandatory Description
X-API-KEY STRING YES

Query Parameters:

Name Type Mandatory Description
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES
signature STRING YES


Websocket Market Streams

Sample ping request

{"event":"ping"}

Sample pong response

{"data":{"timeout_duration":1800},"event":"pong","id":0}

Live Subscribing/Unsubscribing to streams

Subscribe to public streams

{"event":"subscribe","streams":["!ticker@arr"]}

Subscribe to private streams

{"event":"subscribe","streams":["orderUpdate"], "auth_key": "***"}

Payload (same for both public and private):

{
  "data":
  {
    "streams":
    [
    "!ticker@arr"
    ]
  },
  "event":"subscribed",
  "id":0
}

Subscribe to a stream






















Unsubscribing from any stream

{"event":"unsubscribe","streams":["!ticker@arr"]}

Payload:

{
  "data":
  {
    "streams":
    [
    "!ticker@arr"
    ]
  },
  "event":"unsubscribed",
  "id":0
}

Unsubscribe to a stream

Error Messages

Error Message Description
{"data":{"code":400,"message":"Invalid request: streams must be an array"},"event":"error","id":0} This is when key-pair is not valid
{"data":{"code":401,"message":"Invalid request: unauthorized access"},"event":"error","id":0} This is when your auth_key does not have access for a private stream
{"data":{"code":400,"message":"Invalid request: unsupported method","id":0} This is when method is not correct
{"data":{"code":500,"message":"Invalid request: could not parse message","id":0} This is when message cannot be parsed
{"data":{"code":400,"message":"Invalid request: ID must be an unsigned integer","id":0} This is when ID is invalid
{"data":{"code":400,"message":"Invalid request: auth_key must be a string","id":0} This is when auth_key is not a string
{"data":{"code":429,"message":"Too many request: max streams subscription limit reached","id":0} This is when limit reached of maximum requests

Trade Streams

Request

{"event":"subscribe","streams":["btcinr@trades"]}

Payload:

{
  "data":
  {
    "trades":
    [
      {
        "E":1631681323000,  // Event time
        "S":"buy",          // Side
        "a":26946138,       // Buyer order ID
        "b":26946169,       // Seller order ID
        "m":true,           // Is buyer maker?
        "p":"7.0",          // Price
        "q":"15.0",         // Quantity
        "s":"btcinr",       // Symbol
        "t":17376030        // Trade ID
      }
    ]
  },
  "stream":"btcinr@trades"
}

The Trade Streams push raw trade information; each trade has a unique buyer and seller.

Stream Name: <symbol>@trades

All Market Tickers Stream

Request

{"event":"subscribe","streams":["!ticker@arr"]}

Payload:

{
  "data":
  [
    {
      "E":1631625534000,    // Event time
      "T":"SPOT",           // Type
      "U":"wrx",            // Quote unit
      "a":"0.0",            // Best sell price
      "b":"0.0",            // Best buy price
      "c":"5.0",            // Last price
      "h":"5.0",            // High price
      "l":"5.0",            // Low price
      "o":"5.0",            // Open price
      "q":"0.0",            // Quantity
      "s":"btcwrx",         // Symbol
      "u":"btc"             // Base unit
    }
  ],
  "stream":"!ticker@arr"
}

24hr rolling window ticker statistics for all symbols that changed in an array. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note that only tickers that have changed will be present in the array.

Stream Name: !ticker@arr

Kline/Candlestick Stream

Request

{"event":"subscribe","streams":["btcinr@kline_1m"]}

Payload:

{
    "data": {
      "E":1631683058904,      // Event time
      "s": "btcinr",          // Symbol
      "t": 1638747660000,     // Kline start time
      "T": 1638747719999,     // Kline close time
      "i": "1m",              // Interval
      "o": "0.0010",          // Open price
      "c": "0.0020",          // Close price
      "h": "0.0025",          // High price
      "l": "0.0015",          // Low price
      "v": "1000",            // Base asset volume
    },
    "stream": "btcinr@kline_1m"
}

The Kline/Candlestick Stream pushes update of current klines/candlestick every few second.

Kline intervals:

Key Value
m Minutes
h Hours
d Days
w Weeks
M Months

Stream Name: <symbol>@kline_<interval>

Update Speed: 5 seconds

Depth Stream

Request

{"event":"subscribe","streams":["btcinr@depth"]}

Payload:

{
  "data":
  {
    "E":1631682370000,       // Event time
    "a": [                   // Asks to be updated
      [
        "10.0",              // Price level to be updated
        "75.0"               // Quantity
      ]
    ],
    "b": [                   // Bids to be updated
      [
        "6.0",               // Price level to be updated
        "50.0"               // Quantity
      ]
    ],
    "s":"btcinr"             // Symbol
  },
  "stream":"btcinr@depth"
}

Order book price and quantity depth updates.

Stream Name: <symbol>@depth

Update Speed: 3 seconds

Partial Depth Stream

Request

{"event":"subscribe","streams":["btcinr@depth10@100ms"]}

Payload:

{
  "data":
  {
    "E":1631682370000,       // Event time
    "a": [                   // Asks to be updated
      [
        "10.0",              // Price level to be updated
        "75.0"               // Quantity
      ],
      ...
    ],
    "b": [                   // Bids to be updated
      [
        "6.0",               // Price level to be updated
        "50.0"               // Quantity
      ],
      ...
    ],
    "s":"btcinr"             // Symbol
  },
  "stream":"btcinr@depth10@100ms"
}

Order book price and quantity depth updates.

Supported levels - 5, 10 or 20.

Stream Name: <symbol>@depth<level>@100ms

Update Speed: 100 ms

Account Update

Request

{"event":"subscribe","streams":["outboundAccountPosition"], "auth_key":"***"}

Payload:

{
  "data":
  {
    "B": [                            // Balances Array
      {
        "a":"wrx",                    // Asset
        "b":"2043856.426455209",      // Free
        "l":"3001318.98"              // Locked
      }
    ],
    "E":1631683058909                 // Event time
  },
  "stream":"outboundAccountPosition"
}

outboundAccountPosition is sent any time an account balance has changed and contains the assets that were possibly changed by the event that generated the balance change.

Stream Name: outboundAccountPosition

Requires: auth_key

Order Update

Request

{"event":"subscribe","streams":["orderUpdate"], "auth_key":"***"}

Payload:

{
  "data":
  {
    "E":1631683058904,       // Event time
    "O":1631683058000,       // Updated time
    "S":"ask",               // Kind
    "V":"70.0",              // Original volume
    "X":"wait",              // State
    "i":26946170,            // Order ID
    "c":"my_clientorder_1",  // Client Order ID
    "m":true,                // Is market maker?
    "o":"sell",              // Type
    "p":"5.0",               // Price
    "q":"70.0",              // Balance Volume
    "s":"wrxinr",            // Symbol
    "v":"0.0"                // Average price
  },
  "stream":"orderUpdate"
}

Orders are updated with the orderUpdate event.

Stream Name: orderUpdate

Requires: auth_key

Trade Update

Request

{"event":"subscribe","streams":["ownTrade"], "auth_key":"***"}

Payload:

{
  "data":
  {
    "E":1631683058000,      // Event time
    "S":"ask",              // Kind
    "U":"inr",              // Fee currency
    "a":114144050,          // Seller ID
    "b":114144121,          // Buyer ID
    "f":"0.2",              // Fee
    "m":true,               // Is market maker?
    "o":26946170,           // Order ID
    "c":"my_clientorder_1", // Client Order ID
    "p":"5.0",              // Price
    "q":"20.0",             // Quantity
    "s":"btcinr",           // Symbol
    "t":17376032,           // Trade ID
    "w":"100.0"             // Funds
  },
  "stream":"ownTrade"
}

Trades are updated with the ownTrade event.

Stream Name: ownTrade

Requires: auth_key