NAV Navigation
Examples

BlockTrade API v1.0.0

Scroll down for example requests and responses.

Welcome to the Blocktrade API documentation

Below you'll find everything you need to know on how to connect to the Blocktrade API. The API provides all the necessary endpoints you need to conduct your data gathering or automated trading, including trade and order book data, creating orders, tracking portfolios and streaming websockets.

An account is needed to interact with the private part of the API. Register at Blocktrade.com to get the necessary API key and secret.

Getting Started

To try out the examples on Linux or MacOS, copy them to the console and run them. On Windows, curl has to be installed before doing that, you can get it here.

If you have questions or would like to make a feature request or a bug report, don't hesitate contacting us at [email protected].

Base URLs:

Terms of service

Public API

import json
import pprint
from http import client

trading_pair_id = 1

# call the API `GET trades` endpoint
conn = client.HTTPSConnection("trade.blocktrade.com")
conn.request("GET", "/api/v1/trades/%d" % trading_pair_id, headers={
    'Content-Type': 'application/json',
})
response = conn.getresponse()
response_raw = response.read()
try:
    response_json = json.loads(response_raw)
    pprint.pprint(response_json)
except:
    print(response_raw)

No account or credentials are needed to use the public API. All endpoints have a curl example on the right. Copy the example your console, adjust the parameters, and run it to see the response.

Immediately to the right is also an example of how to do a request to the public API using Python 3.

Trading Assets

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/trading_assets \
  -H 'Accept: application/json'

GET /trading_assets

Get all available trading assets

Example responses

200 Response

[
  {
    "id": 2,
    "full_name": "Test Euro",
    "iso_code": "tEUR",
    "icon_path": "/media/eur.svg",
    "icon_path_png": "/media/eur.png",
    "color": "#3A61AD",
    "sign": "€",
    "currency_type": "FIAT",
    "minimal_withdrawal_amount": "0.01",
    "minimal_order_value": "0.1",
    "maximum_order_value": 620000,
    "decimal_precision": 2,
    "lot_size": "0.1"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [TradingAsset] false none none
» id integer false none none
» full_name string false none none
» iso_code string false none none
» icon_path string false none none
» icon_path_png string false none none
» color string false none none
» sign string|null false none none
» currency_type string false none Currency type
» minimal_withdrawal_amount string false none none
» minimal_order_value string false none none
» maximum_order_value string false none none
» decimal_precision integer false none none
» lot_size string false none none

Enumerated Values

Property Value
currency_type FIAT
currency_type CRYPTOCURRENCY

Trading Pairs

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/trading_pairs \
  -H 'Accept: application/json'

GET /trading_pairs

Get all available trading pairs

Example responses

200 Response

[
  {
    "id": 1,
    "base_asset_id": 3,
    "quote_asset_id": 2,
    "decimal_precision": 2,
    "lot_size": "0.01",
    "tick_size": "0.00001"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [TradingPair] false none none
» id integer false none none
» base_asset_id integer false none none
» quote_asset_id integer false none none
» decimal_precision integer false none none
» lot_size string false none Lot size of the base trading asset
» tick_size string false none none

Order Book

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/order_book/{trading_pair_id} \
  -H 'Accept: application/json'

GET /order_book/{trading_pair_id}

Get order book based on trading pair ID

Parameters

Parameter In Type Required Description
trading_pair_id path integer true ID of trading_pair

Example responses

200 Response

{
  "asks": [
    {
      "amount": "2.20535071",
      "price": "6140.11",
      "value": "13541.09"
    }
  ],
  "bids": [
    {
      "amount": "2.20535071",
      "price": "6140.11",
      "value": "13541.09"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation OrderBook
404 Not Found Order book not found Error

Ticker

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/ticker/{trading_pair_id} \
  -H 'Accept: application/json'

GET /ticker/{trading_pair_id}

Get ticker based on trading pair ID

Parameters

Parameter In Type Required Description
trading_pair_id path integer true ID of trading_pair

Example responses

200 Response

{
  "last_price": "6039.3",
  "bid_price": "6050.17",
  "ask_price": "6056.77",
  "volume": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Ticker
404 Not Found Trading pair Last price not found

Trades

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/trades/{trading_pair_id} \
  -H 'Accept: application/json'

GET /trades/{trading_pair_id}

Get trades for given trading pair ID

Parameters

Parameter In Type Required Description
trading_pair_id path integer true ID of trading_pair

Example responses

200 Response

{
  "data": [
    {
      "id": 12834779,
      "order_id": 16329236,
      "matched_order_id": 16284185,
      "trading_pair_id": 1,
      "direction": "SELL",
      "amount": "0.1734811",
      "price": "6048.22",
      "date": 1533543752844
    }
  ],
  "count": 1293512,
  "offset": 0,
  "limit": 10
}

Responses

Status Meaning Description Schema
200 OK Successful operation AllTrades
403 Forbidden Operation forbidden Error
404 Not Found Trading pair not found Error

Private API

import hashlib
import hmac
from http import client
import time
import pprint
import json

# enter your API key and secret
API_KEY = 'YOUR_API_KEY'
API_SECRET = 'YOUR_API_SECRET'

# nonce must be increased and unique on each subsequent request
NONCE = int(time.time())

def gen_signature(api_key, api_secret, nonce, request_body=''):
    """Generates the signature for the given request. `request_body` should contain any POST data."""
    message = '{}.{}'.format(api_key, nonce).encode()
    if request_body:
        message += '.{}'.format(request_body).encode()
    return hmac.new(api_secret.encode(), msg=message, digestmod=hashlib.sha256).hexdigest().upper()

data = dict(
            portfolio_id=1,
            direction='BUY',
            type='LIMIT',
            trading_pair_id=1,
            amount='0.1',
            price='0.1',
        )

data_str = json.dumps(data)

# generate the signature for the request
signature = gen_signature(API_KEY, API_SECRET, NONCE, data_str)

headers = {
    'X-Api-Key': API_KEY,
    'X-Nonce': NONCE,
    'X-Signature': signature,
    'Content-Type': 'application/json',
}

# call the API `POST orders` endpoint
conn = client.HTTPSConnection("trade.blocktrade.com")
conn.request("POST", "/api/v1/orders", body=data_str, headers=headers)
response = conn.getresponse()
response_raw = response.read()
try:
    response_json = json.loads(response_raw)
    pprint.pprint(response_json)
except:
    print(response_raw)

To use the endpoints in the private part of the Blocktrade API, you first have do get your API key and secret. These can be generated by logging in, going to Settings, then API Keys. A good practice is to generate a separate API key/secret pair for each application.

In addition to Content-Type: application/json, three additional headers related to authentication should be present when using the private API:

Header Description
X-Api-Key The API key generated under your account's Settings -> API Keys
X-Nonce Nonce is a number that should be increased with each request in order to avoid the replay attack. Often, the epoch integer value is used.
X-Signature To cryptographically sign the request, calculate a HMAC signature, using SHA-256. See below for details.

The signature is calculated first creating a string YOUR_API_KEY.YOUR_NONCE.YOUR_JSON_REQUEST_BODY and encoding it with UTF-8. This is then HMAC encoded with your API secret, using the SHA256 hashing algorithm. All characters are then changed to uppercase. See the code on the right for a complete example in Python 3.

Note: In the case of a GET request, the signature should be calculated by having the request body as an empty string.

User Orders

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/orders \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /orders

Get all user's orders

Parameters

Parameter In Type Required Description
offset query integer false Offset of orders to start from, default 0
limit query integer false Number of orders per page, default 10, maximum 1000
status query string false List of statuses separated by ',' sign, which orders will be filtered by
type query string false List of order types separated by ',' sign, which orders will be filtered by
trading_pair_id query string false List of trading pair ids separated by ',' sign, which orders will be filtered by

Example responses

200 Response

{
  "data": [
    {
      "id": 14804210,
      "portfolio_id": 1,
      "trading_pair_id": 1,
      "direction": "BUY",
      "type": "LIMIT",
      "amount": "0.2",
      "remaining_amount": "0.1",
      "price": "6048.22",
      "time_in_force": "GTC",
      "stop_price": null,
      "date": 1533456985351,
      "status": "PARTIALLY_FILLED",
      "trades": [
        {
          "amount": "0.1",
          "price": "6048.22",
          "time": 1533543752844
        }
      ]
    }
  ],
  "count": 2,
  "offset": 0,
  "limit": 10
}

Responses

Status Meaning Description Schema
200 OK Successful operation UserOrders
403 Forbidden Operation forbidden Error

Place New Order

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/orders \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /orders

Place new order

Note: The order price must be an integer factor of the tick size. In other words, the price cannot be more granular than its tick size.

Here are the current tick sizes:

Trading pair Tick size
ETH/BTC 0.00001
BCH/BTC 0.00001
XRP/BTC 0.00000001
LTC/BTC 0.00001
BCH/ETH 0.001
XRP/ETH 0.00000001
LTC/ETH 0.00001

Body parameter

{
  "portfolio_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "trading_pair_id": 1,
  "amount": "0.1",
  "price": 1000,
  "time_in_force": "GTC",
  "stop_price": null
}

Parameters

Parameter In Type Required Description
body body NewOrderRequest true Data needed for placing order

Example responses

200 Response

{
  "id": 16342774
}

Responses

Status Meaning Description Schema
200 OK Successful operation NewlyPlacedOrder
400 Bad Request Operation with invalid arguments Error
403 Forbidden Operation forbidden Error
404 Not Found Trading pair not found Error
409 Conflict Operation's arguments caused conflict Error

Cancel All Active Orders

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/orders/cancel_active \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /orders/cancel_active

Cancells all active orders

Responses

Status Meaning Description Schema
202 Accepted Bulk cancellation request accepted None

Order Details

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/orders/{id} \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /orders/{id}

Get order details

Parameters

Parameter In Type Required Description
id path integer true ID of order

Example responses

200 Response

{
  "id": 14804210,
  "portfolio_id": 1,
  "trading_pair_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "amount": "0.2",
  "remaining_amount": "0.1",
  "price": "6048.22",
  "time_in_force": "GTC",
  "stop_price": null,
  "date": 1533456985351,
  "status": "PARTIALLY_FILLED",
  "trades": [
    {
      "amount": "0.1",
      "price": "6048.22",
      "time": 1533543752844
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation UserOrder
403 Forbidden Operation forbidden Error
404 Not Found Order not found Error

Cancel Order

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/orders/{id}/cancel \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /orders/{id}/cancel

Cancel order

Parameters

Parameter In Type Required Description
id path integer true ID of order

Example responses

403 Response

{
  "message": "Error message"
}

Responses

Status Meaning Description Schema
202 Accepted Cancellation request accepted None
403 Forbidden Operation forbidden Error
404 Not Found Order/Trading pair not found Error
409 Conflict Operation's arguments caused conflict Error
422 Unprocessable Entity Order can not be cancelled Error

User Portfolios

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/portfolios \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /portfolios

Get all available user's portfolios

Example responses

200 Response

{
  "id": 916,
  "assets": [
    {
      "trading_asset_id": 2,
      "available_amount": "24990.00",
      "reserved_amount": "24990.00",
      "wallet_address": "b33e642-9279-4380-a3f2-9b5d1fcc30c6'"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Portfolio
403 Forbidden Operation forbidden Error

Withdraw

Code samples

# You can also use wget
curl -X POST https://trade.blocktrade.com/api/v1/portfolios/{id}/withdraw \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

POST /portfolios/{id}/withdraw

Withdraw crypto currency based on portfolio ID, trading asset, destination_address, message and amount.

Note: In the case of withdrawing to a XRP destination address, the proper format of the destination address is the_address?dt=the_destination_tag_number.

Body parameter

{
  "amount": 24990,
  "trading_asset_id": 2,
  "message": "The withdrawal message",
  "destination_address": "175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"
}

Parameters

Parameter In Type Required Description
id path integer true ID of portfolio
body body object true Data needed for withdraw
» amount body string true Amount of withdraw, number as string
» trading_asset_id body integer true Trading asset of withdraw
» message body string false Message of withdraw
» destination_address body string true Destination address where to withdraw

Example responses

200 Response

[
  {
    "id": 916,
    "assets": [
      {
        "trading_asset_id": 2,
        "available_amount": "24990.00",
        "reserved_amount": "24990.00",
        "wallet_address": "b33e642-9279-4380-a3f2-9b5d1fcc30c6'"
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline
400 Bad Request Operation with invalid arguments Error
403 Forbidden Operation forbidden Error
404 Not Found Portfolio User not found
409 Conflict Operation's arguments caused conflict Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Portfolio] false none none
» id integer false none none
» assets [PortfolioAsset] false none none
»» trading_asset_id integer false none none
»» available_amount string false none none
»» reserved_amount string false none none
»» wallet_address string|null false none none

User

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/user \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /user

Get the user data

Example responses

200 Response

{
  "user_id": 952,
  "email": "[email protected]",
  "primary_currency": {
    "id": 2,
    "name": "tEUR"
  },
  "kyc_status": "OK",
  "websocket_auth_token": "1111111111111111111111111111111111111111",
  "is_2fa_enabled": true,
  "first_name": "FirstName",
  "last_name": "LastName",
  "gender": "Mal",
  "date_of_birth": 1533552012,
  "place_of_birth": "SomeCity",
  "address": "SomeAddress",
  "postal_code": 1234,
  "city": "SomeCity",
  "state": "SomeState",
  "country": "SomeCountry",
  "phone_number": "+1 123 456"
}

Responses

Status Meaning Description Schema
200 OK Successful operation User
403 Forbidden Operation forbidden Error

Fees

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/fees \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /fees

Get the fee data

Example responses

200 Response

{
  "TRADING": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_CREDIT_CARD": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_OUTSIDE_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT_OUTSIDE_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "MINER_FEE": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation FeeType
403 Forbidden Operation forbidden Error

Settings

Code samples

# You can also use wget
curl -X GET https://trade.blocktrade.com/api/v1/settings \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: VALUE' \
  -H 'X-Nonce: VALUE' \
  -H 'X-Signature: VALUE'

GET /settings

Get the settings

Example responses

200 Response

{
  "rounding_policy": {
    "BUY_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
    "SELL_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
    "PORTFOLIO_TOTAL_VALUE": "ROUNDING_DOWN",
    "SERVICE_VALUE": "ROUNDING_DOWN",
    "MINER_FEE": "ROUNDING_DOWN",
    "TRADING": "ROUNDING_DOWN",
    "TRANSFER_IN_CREDIT_CARD": "ROUNDING_DOWN",
    "TRANSFER_IN_SEPA": "ROUNDING_DOWN",
    "TRANSFER_IN_OUTSIDE_SEPA": "ROUNDING_DOWN",
    "TRANSFER_OUT": "ROUNDING_DOWN",
    "TRANSFER_OUT_SEPA": "ROUNDING_DOWN",
    "TRANSFER_OUT_OUTSIDE_SEPA": "ROUNDING_DOWN"
  },
  "features": {
    "disable_deposit_and_withdraw": true,
    "disable_kyc_verification": true,
    "disable_fill_or_kill": true,
    "disable_stop_order": true,
    "show_beta_icons": true,
    "subscriptions": true
  }
}

Responses

Status Meaning Description Schema
200 OK Successful operation Settings
403 Forbidden Operation forbidden Error

Websockets

  # Install the websocket-client library with:
  # > pip install websocket-client

  from websocket import WebSocketApp

  def on_message(ws, message):
      print(message)

  def on_error(ws, error):
      print(error)

  def on_open(ws):
      ws.send("""{ "subscribe_order_book": { "trading_pair_id": 1 } }""")

  app = WebSocketApp("wss://trade.blocktrade.com/ws/v1/notification",
                    on_message=on_message,
                    on_error=on_error)
  app.on_open = on_open
  app.run_forever()

URLs

There is one common endpoint for all websockets connections with the same hostname as REST API:

/ws/v1/notification

Channels and data subscriptions

Newly connected clients will not receive any data until they subscribe for a specific channel. Channels is an abstraction over certain kind of data. Channels can be parametrized by clients to narrow down results. A common use case is to observe only few trading pairs to get data for drawing charts.

Once client subscribes, service sends current state or initial date, depending on a channel. For example, portfolio channel sends current portfolio state immediately.

Data is sent until client disconnects or sends unsubscribe message.

Authentication mechanism

Authentication is needed only for two channels: Portfolio and User Orders. There are two ways of authenticating:

# The subscription request when authenticating with auth_token:
{
    "subscribe_user_orders": {
        "auth_token": "YOUR_AUTH_TOKEN"
    }
}
  1. Authenticate with auth_token which you send as subscribe request field. auth_token is available the at the /user REST endpoint. See an example of subscribe_user_orders on the right.
# Authenticating with headers when initiating the connection:
signature = gen_signature(API_KEY, API_SECRET, NONCE)
headers = {
    'X-Api-Key': API_KEY,
    'X-Nonce': NONCE,
    'X-Signature': signature,
}
app = WebSocketApp(..., header=headers)
  1. Authenticate directly with using X-Api-Key/X-Nonce/X-Signature by setting the headers when initiating the Websocket connection. In this case, you do not set the auth_token field (subscribe_user_orders would have no fields set). See the code on the right.

See the Private API section for the definition of gen_signature.

Order Book (Websockets)

Code samples

WS /ws/v1/notification (Order Book)

Order book websocket data. The first message received after subscribe is the full order book. The following messages are updates only. Both types of messages have the same JSON structure.

Order book

Current bids and asks, aggregated.

Subscribe message format

{
    "subscribe_order_book": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Unsubscribe message format

{
    "unsubscribe_order_book": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Example responses

default Response

{
  "message_type": "order_book",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "bids": [
          {
            "price": "6043.23",
            "amount": "2.5510545",
            "value": "15417.19"
          }
        ],
        "asks": [
          {
            "price": "6044.1",
            "amount": "4.81763208",
            "value": "29118.25"
          }
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketOrderBook

Trades (Websockets)

Code samples

WS /ws/v1/notification (Trades)

Trades websocket data

Subscribe message format

{
    "subscribe_trades": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Unsubscribe message format

{
    "unsubscribe_trades": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Example responses

default Response

{
  "message_type": "trades",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "price": "6045.37",
        "amount": "0.48216109",
        "time": 1533553731493
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketTrades

Ticker (Websockets)

Code samples

WS /ws/v1/notification (Ticker)

Ticker websocket data

Subscribe message format

{
    "subscribe_ticker": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Unsubscribe message format

{
    "unsubscribe_ticker": {
        "trading_pair_id": 1
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API

Example responses

default Response

{
  "message_type": "ticker",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "ask_price": "6045.72",
        "bid_price": "6044.69",
        "last_price": "6045.72",
        "volume": "string"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketTicker

OHLCV (Websockets)

Code samples

WS /ws/v1/notification (OHLCV)

Open, high, low, close, volume data

{
    "subscribe_ohlcv": {
        "trading_pair_id": 1,
        "resolution": 86400,
        "start_time": 1533081600000,
        "end_time": 1849046400000
    }
}

Subscribe message format

Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API
resolution resolution of a single data point (86400 means that client will get data points by day)
start_time (optional) timestamp of first data point (historical). If omitted we assume now - 40 * resolution
end_time (optional) timestamp of last data point. If omitted assume now. If start_time is omitted, this is ignored

Unsubscribe message format

{
    "unsubscribe_ohlcv": {
        "trading_pair_id": 1,
        "resolution": 86400,
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API
resolution resolution of a single data point (86400 means that client will get data points by day)

Example responses

default Response

{
  "message_type": "ohlcv",
  "payload": {
    "trading_pair_id": 1,
    "resolution": 86400,
    "oldest_available_data_point": 1532476800000,
    "data": [
      {
        "date": 1533513600000,
        "close": "6042.32",
        "volume": "408815169.35",
        "open": "6073.9",
        "high": "6167.15",
        "low": "6011.3"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketOHLCV

Line Chart (Websockets)

Code samples

WS /ws/v1/notification (Line Chart)

Line chart data

Line chart data

Data by trading pair, suitable for line charts.

Subscribe message format

{
  "subscribe_line": {
      "trading_pair_id": 1,
      "resolution": 86400,
      "start_time": 1533081600000,
      "end_time": 1849046400000
  }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API
resolution resolution of a single data point (86400 means that client will get data points by day)
start_time (optional) timestamp of first data point (historical). If omitted we assume now - 40 * resolution
end_time (optional) timestamp of last data point. If omitted assume now. If start_time is omitted, this is ignored

Unsubscribe message format

{
    "unsubscribe_line": {
        "trading_pair_id": 1,
        "resolution": 86400
    }
}
Name Description
trading_pair_id id of trading pair, full list can be obtained using REST API
resolution resolution of a single data point (86400 means that client will get data points by day)

Example responses

default Response

{
  "message_type": "line",
  "payload": {
    "trading_pair_id": 1,
    "resolution": 86400,
    "dailyChange": "155.85",
    "dailyHigh": "6167.15",
    "dailyLow": "6011.3",
    "dailyVolume": "418693670.8",
    "data": [
      {
        "date": 1533513600000,
        "value": "6045.34"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketLineChart

Portfolio (Websockets)

Code samples

WS /ws/v1/notification (Portfolio)

Portfolio websocket data

Subscribe message format

{
    "subscribe_portfolio": {
        "auth_token": "1111111111111111111111111111111111111111"
    }
}
Name Description
auth_token the authentication token, obtained using REST API

Unsubscribe message format

{
    "unsubscribe_portfolio": {}
}

Example responses

default Response

{
  "message_type": "portfolio",
  "payload": {
    "data": [
      {
        "id": 916,
        "assets": [
          {
            "trading_asset_id": 2,
            "available_amount": "24990.00",
            "reserved_amount": "24990.00",
            "wallet_address": "11111111-1111-1111-1111-111111111111"
          }
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketPortfolio

User Orders (Websockets)

Code samples

WS /ws/v1/notification (User Orders)

User Orders websocket data

Subscribe message format

{
    "subscribe_user_orders": {
        "auth_token": "1111111111111111111111111111111111111111"
    }
}
Name Description
auth_token the authentication token, obtained using REST API

Unsubscribe message format

{
    "unsubscribe_user_orders": {}
}

Example responses

default Response

{
  "message_type": "user_orders",
  "payload": {
    "data": [
      {
        "id": 16575930,
        "portfolio_id": 1,
        "trading_pair_id": 1,
        "direction": "BUY",
        "type": "LIMIT",
        "amount": "0.1",
        "remaining_amount": "0.05",
        "price": "100",
        "time_in_force": "GTC",
        "stop_price": null,
        "date": 1533555163180,
        "status": "PARTIALLY_FILLED",
        "trades": [
          {
            "amount": "0.05",
            "price": "100",
            "time": 1533555164180
          }
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
default Default Successful operation WebsocketUserOrders

Schemas

FeeType

{
  "TRADING": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_CREDIT_CARD": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_IN_OUTSIDE_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT_OUTSIDE_SEPA": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "MINER_FEE": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  },
  "TRANSFER_OUT": {
    "<trading_asset_id> or `default`": {
      "min_fee": "0",
      "percent_value": "0"
    }
  }
}

Properties

Name Type Required Restrictions Description
TRADING Fee false none none
TRANSFER_IN_CREDIT_CARD Fee false none none
TRANSFER_IN_SEPA Fee false none none
TRANSFER_IN_OUTSIDE_SEPA Fee false none none
TRANSFER_OUT_SEPA Fee false none none
TRANSFER_OUT_OUTSIDE_SEPA Fee false none none
MINER_FEE Fee false none none
TRANSFER_OUT Fee false none none

Fee

{
  "<trading_asset_id> or `default`": {
    "min_fee": "0",
    "percent_value": "0"
  }
}

Properties

Name Type Required Restrictions Description
<trading_asset_id> or default object false none trading_asset_id or default
» min_fee string|null false none none
» percent_value string|null false none none

User

{
  "user_id": 952,
  "email": "[email protected]",
  "primary_currency": {
    "id": 2,
    "name": "tEUR"
  },
  "kyc_status": "OK",
  "websocket_auth_token": "1111111111111111111111111111111111111111",
  "is_2fa_enabled": true,
  "first_name": "FirstName",
  "last_name": "LastName",
  "gender": "Mal",
  "date_of_birth": 1533552012,
  "place_of_birth": "SomeCity",
  "address": "SomeAddress",
  "postal_code": 1234,
  "city": "SomeCity",
  "state": "SomeState",
  "country": "SomeCountry",
  "phone_number": "+1 123 456"
}

Properties

Name Type Required Restrictions Description
user_id integer false none none
email string false none none
primary_currency TradingAssetAsPrimary false none none
kyc_status string false none none
websocket_auth_token string false none none
is_2fa_enabled boolean false none none
first_name string|null false none none
last_name string|null false none none
gender string|null false none none
date_of_birth integer|null false none UTC timestamp of the date of birth in the midnight of this day, in milliseconds
place_of_birth string|null false none none
address string|null false none none
postal_code string|null false none none
city string|null false none none
state string|null false none none
country string|null false none none
phone_number string|null false none none

TradingAssetAsPrimary

{
  "id": 2,
  "name": "tEUR"
}

Properties

Name Type Required Restrictions Description
id integer false none none
name string false none none

TradingAsset

{
  "id": 2,
  "full_name": "Test Euro",
  "iso_code": "tEUR",
  "icon_path": "/media/eur.svg",
  "icon_path_png": "/media/eur.png",
  "color": "#3A61AD",
  "sign": "€",
  "currency_type": "FIAT",
  "minimal_withdrawal_amount": "0.01",
  "minimal_order_value": "0.1",
  "maximum_order_value": 620000,
  "decimal_precision": 2,
  "lot_size": "0.1"
}

Properties

Name Type Required Restrictions Description
id integer false none none
full_name string false none none
iso_code string false none none
icon_path string false none none
icon_path_png string false none none
color string false none none
sign string|null false none none
currency_type string false none Currency type
minimal_withdrawal_amount string false none none
minimal_order_value string false none none
maximum_order_value string false none none
decimal_precision integer false none none
lot_size string false none none

Enumerated Values

Property Value
currency_type FIAT
currency_type CRYPTOCURRENCY

TradingPair

{
  "id": 1,
  "base_asset_id": 3,
  "quote_asset_id": 2,
  "decimal_precision": 2,
  "lot_size": "0.01",
  "tick_size": "0.00001"
}

Properties

Name Type Required Restrictions Description
id integer false none none
base_asset_id integer false none none
quote_asset_id integer false none none
decimal_precision integer false none none
lot_size string false none Lot size of the base trading asset
tick_size string false none none

Portfolio

{
  "id": 916,
  "assets": [
    {
      "trading_asset_id": 2,
      "available_amount": "24990.00",
      "reserved_amount": "24990.00",
      "wallet_address": "b33e642-9279-4380-a3f2-9b5d1fcc30c6'"
    }
  ]
}

Properties

Name Type Required Restrictions Description
id integer false none none
assets [PortfolioAsset] false none none

PortfolioAsset

{
  "trading_asset_id": 2,
  "available_amount": "24990.00",
  "reserved_amount": "24990.00",
  "wallet_address": "b33e642-9279-4380-a3f2-9b5d1fcc30c6'"
}

Properties

Name Type Required Restrictions Description
trading_asset_id integer false none none
available_amount string false none none
reserved_amount string false none none
wallet_address string|null false none none

NewOrderRequest

{
  "portfolio_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "trading_pair_id": 1,
  "amount": "0.1",
  "price": 1000,
  "time_in_force": "GTC",
  "stop_price": null
}

Properties

Name Type Required Restrictions Description
portfolio_id integer true none ID of portfolio
direction string true none none
type string true none none
trading_pair_id integer true none Trading pair id
amount string true none Amount of asset, number as string
price string false none Price for one unit of asset, number as string
time_in_force string false none none
stop_price string false none Order stop price, number as string

Enumerated Values

Property Value
direction BUY
direction SELL
type LIMIT
type MARKET
time_in_force GTC

NewlyPlacedOrder

{
  "id": 16342774
}

Properties

Name Type Required Restrictions Description
id integer false none none

UserOrders

{
  "data": [
    {
      "id": 14804210,
      "portfolio_id": 1,
      "trading_pair_id": 1,
      "direction": "BUY",
      "type": "LIMIT",
      "amount": "0.2",
      "remaining_amount": "0.1",
      "price": "6048.22",
      "time_in_force": "GTC",
      "stop_price": null,
      "date": 1533456985351,
      "status": "PARTIALLY_FILLED",
      "trades": [
        {
          "amount": "0.1",
          "price": "6048.22",
          "time": 1533543752844
        }
      ]
    }
  ],
  "count": 2,
  "offset": 0,
  "limit": 10
}

Properties

Name Type Required Restrictions Description
data [UserOrder] false none none
count integer false none Number of all orders
offset integer false none Offset of orders to start from
limit integer false none Number of orders per page

UserOrder

{
  "id": 14804210,
  "portfolio_id": 1,
  "trading_pair_id": 1,
  "direction": "BUY",
  "type": "LIMIT",
  "amount": "0.2",
  "remaining_amount": "0.1",
  "price": "6048.22",
  "time_in_force": "GTC",
  "stop_price": null,
  "date": 1533456985351,
  "status": "PARTIALLY_FILLED",
  "trades": [
    {
      "amount": "0.1",
      "price": "6048.22",
      "time": 1533543752844
    }
  ]
}

Properties

Name Type Required Restrictions Description
id integer false none none
portfolio_id integer false none none
trading_pair_id integer false none none
direction string false none none
type string false none none
amount string false none none
remaining_amount string false none none
price string false none Price for one unit of asset
time_in_force string false none none
stop_price string false none Order stop price, number as string
date integer false none UTC timestamp of the last change, in milliseconds
status string false none none
trades [OrderTrade] false none none

Enumerated Values

Property Value
direction BUY
direction SELL
type LIMIT
type MARKET
time_in_force GTC
status NEW
status PARTIALLY_FILLED
status FILLED
status CANCELLED

OrderTrade

{
  "amount": "0.1",
  "price": "6048.22",
  "time": 1533543752844
}

Properties

Name Type Required Restrictions Description
amount string false none Amount of traded assets, number as string
price string false none Price for one unit of asset
time integer false none none

AllTrades

{
  "data": [
    {
      "id": 12834779,
      "order_id": 16329236,
      "matched_order_id": 16284185,
      "trading_pair_id": 1,
      "direction": "SELL",
      "amount": "0.1734811",
      "price": "6048.22",
      "date": 1533543752844
    }
  ],
  "count": 1293512,
  "offset": 0,
  "limit": 10
}

Properties

Name Type Required Restrictions Description
data [Trade] false none none
count integer false none Number of all trades
offset integer false none Offset of trades to start from
limit integer false none Number of trades per page

Trade

{
  "id": 12834779,
  "order_id": 16329236,
  "matched_order_id": 16284185,
  "trading_pair_id": 1,
  "direction": "SELL",
  "amount": "0.1734811",
  "price": "6048.22",
  "date": 1533543752844
}

Properties

Name Type Required Restrictions Description
id integer false none none
order_id integer false none none
matched_order_id integer false none none
trading_pair_id integer false none none
direction string false none none
amount string false none none
price string false none Price for one unit of asset
date integer false none UTC timestamp of the trade, in milliseconds

Enumerated Values

Property Value
direction BUY
direction SELL

Ticker

{
  "last_price": "6039.3",
  "bid_price": "6050.17",
  "ask_price": "6056.77",
  "volume": "string"
}

Properties

Name Type Required Restrictions Description
last_price string|null false none Number as string
bid_price string|null false none Number as string
ask_price string|null false none Number as string
volume string|null false none 24h volume; number as string

OrderBook

{
  "asks": [
    {
      "amount": "2.20535071",
      "price": "6140.11",
      "value": "13541.09"
    }
  ],
  "bids": [
    {
      "amount": "2.20535071",
      "price": "6140.11",
      "value": "13541.09"
    }
  ]
}

Properties

Name Type Required Restrictions Description
asks [Order] false none none
bids [Order] false none none

Order

{
  "amount": "2.20535071",
  "price": "6140.11",
  "value": "13541.09"
}

Properties

Name Type Required Restrictions Description
amount string false none Number as string
price string false none Number as string
value string false none Number as string

Error

{
  "message": "Error message"
}

Properties

Name Type Required Restrictions Description
message string false none none

RoundingPolicy

{
  "BUY_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
  "SELL_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
  "PORTFOLIO_TOTAL_VALUE": "ROUNDING_DOWN",
  "SERVICE_VALUE": "ROUNDING_DOWN",
  "MINER_FEE": "ROUNDING_DOWN",
  "TRADING": "ROUNDING_DOWN",
  "TRANSFER_IN_CREDIT_CARD": "ROUNDING_DOWN",
  "TRANSFER_IN_SEPA": "ROUNDING_DOWN",
  "TRANSFER_IN_OUTSIDE_SEPA": "ROUNDING_DOWN",
  "TRANSFER_OUT": "ROUNDING_DOWN",
  "TRANSFER_OUT_SEPA": "ROUNDING_DOWN",
  "TRANSFER_OUT_OUTSIDE_SEPA": "ROUNDING_DOWN"
}

Properties

Name Type Required Restrictions Description
BUY_ORDER_TOTAL_VALUE string false none none
SELL_ORDER_TOTAL_VALUE string false none none
PORTFOLIO_TOTAL_VALUE string false none none
SERVICE_VALUE string false none none
MINER_FEE string false none none
TRADING string false none none
TRANSFER_IN_CREDIT_CARD string false none none
TRANSFER_IN_SEPA string false none none
TRANSFER_IN_OUTSIDE_SEPA string false none none
TRANSFER_OUT string false none none
TRANSFER_OUT_SEPA string false none none
TRANSFER_OUT_OUTSIDE_SEPA string false none none

Enumerated Values

Property Value
BUY_ORDER_TOTAL_VALUE ROUNDING_DOWN
BUY_ORDER_TOTAL_VALUE ROUNDING_HALF_DOWN
BUY_ORDER_TOTAL_VALUE ROUNDING_HALF_UP
BUY_ORDER_TOTAL_VALUE ROUNDING_UP
SELL_ORDER_TOTAL_VALUE ROUNDING_DOWN
SELL_ORDER_TOTAL_VALUE ROUNDING_HALF_DOWN
SELL_ORDER_TOTAL_VALUE ROUNDING_HALF_UP
SELL_ORDER_TOTAL_VALUE ROUNDING_UP
PORTFOLIO_TOTAL_VALUE ROUNDING_DOWN
PORTFOLIO_TOTAL_VALUE ROUNDING_HALF_DOWN
PORTFOLIO_TOTAL_VALUE ROUNDING_HALF_UP
PORTFOLIO_TOTAL_VALUE ROUNDING_UP
SERVICE_VALUE ROUNDING_DOWN
SERVICE_VALUE ROUNDING_HALF_DOWN
SERVICE_VALUE ROUNDING_HALF_UP
SERVICE_VALUE ROUNDING_UP
MINER_FEE ROUNDING_DOWN
MINER_FEE ROUNDING_HALF_DOWN
MINER_FEE ROUNDING_HALF_UP
MINER_FEE ROUNDING_UP
TRADING ROUNDING_DOWN
TRADING ROUNDING_HALF_DOWN
TRADING ROUNDING_HALF_UP
TRADING ROUNDING_UP
TRANSFER_IN_CREDIT_CARD ROUNDING_DOWN
TRANSFER_IN_CREDIT_CARD ROUNDING_HALF_DOWN
TRANSFER_IN_CREDIT_CARD ROUNDING_HALF_UP
TRANSFER_IN_CREDIT_CARD ROUNDING_UP
TRANSFER_IN_SEPA ROUNDING_DOWN
TRANSFER_IN_SEPA ROUNDING_HALF_DOWN
TRANSFER_IN_SEPA ROUNDING_HALF_UP
TRANSFER_IN_SEPA ROUNDING_UP
TRANSFER_IN_OUTSIDE_SEPA ROUNDING_DOWN
TRANSFER_IN_OUTSIDE_SEPA ROUNDING_HALF_DOWN
TRANSFER_IN_OUTSIDE_SEPA ROUNDING_HALF_UP
TRANSFER_IN_OUTSIDE_SEPA ROUNDING_UP
TRANSFER_OUT ROUNDING_DOWN
TRANSFER_OUT ROUNDING_HALF_DOWN
TRANSFER_OUT ROUNDING_HALF_UP
TRANSFER_OUT ROUNDING_UP
TRANSFER_OUT_SEPA ROUNDING_DOWN
TRANSFER_OUT_SEPA ROUNDING_HALF_DOWN
TRANSFER_OUT_SEPA ROUNDING_HALF_UP
TRANSFER_OUT_SEPA ROUNDING_UP
TRANSFER_OUT_OUTSIDE_SEPA ROUNDING_DOWN
TRANSFER_OUT_OUTSIDE_SEPA ROUNDING_HALF_DOWN
TRANSFER_OUT_OUTSIDE_SEPA ROUNDING_HALF_UP
TRANSFER_OUT_OUTSIDE_SEPA ROUNDING_UP

Features

{
  "disable_deposit_and_withdraw": true,
  "disable_kyc_verification": true,
  "disable_fill_or_kill": true,
  "disable_stop_order": true,
  "show_beta_icons": true,
  "subscriptions": true
}

Properties

Name Type Required Restrictions Description
disable_deposit_and_withdraw boolean false none none
disable_kyc_verification boolean false none none
disable_fill_or_kill boolean false none none
disable_stop_order boolean false none none
show_beta_icons boolean false none none
subscriptions boolean false none none

Settings

{
  "rounding_policy": {
    "BUY_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
    "SELL_ORDER_TOTAL_VALUE": "ROUNDING_DOWN",
    "PORTFOLIO_TOTAL_VALUE": "ROUNDING_DOWN",
    "SERVICE_VALUE": "ROUNDING_DOWN",
    "MINER_FEE": "ROUNDING_DOWN",
    "TRADING": "ROUNDING_DOWN",
    "TRANSFER_IN_CREDIT_CARD": "ROUNDING_DOWN",
    "TRANSFER_IN_SEPA": "ROUNDING_DOWN",
    "TRANSFER_IN_OUTSIDE_SEPA": "ROUNDING_DOWN",
    "TRANSFER_OUT": "ROUNDING_DOWN",
    "TRANSFER_OUT_SEPA": "ROUNDING_DOWN",
    "TRANSFER_OUT_OUTSIDE_SEPA": "ROUNDING_DOWN"
  },
  "features": {
    "disable_deposit_and_withdraw": true,
    "disable_kyc_verification": true,
    "disable_fill_or_kill": true,
    "disable_stop_order": true,
    "show_beta_icons": true,
    "subscriptions": true
  }
}

Properties

Name Type Required Restrictions Description
rounding_policy RoundingPolicy false none none
features Features false none none

WebsocketOHLCV

{
  "message_type": "ohlcv",
  "payload": {
    "trading_pair_id": 1,
    "resolution": 86400,
    "oldest_available_data_point": 1532476800000,
    "data": [
      {
        "date": 1533513600000,
        "close": "6042.32",
        "volume": "408815169.35",
        "open": "6073.9",
        "high": "6167.15",
        "low": "6011.3"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none ohlcv
payload object false none none
» trading_pair_id integer false none none
» resolution integer false none none
» oldest_available_data_point integer false none none
» data [object] false none none
»» date integer false none UTC timestamp of the trade, in milliseconds
»» close string false none none
»» volume string false none none
»» open string false none none
»» high string false none none
»» low string false none none

WebsocketLineChart

{
  "message_type": "line",
  "payload": {
    "trading_pair_id": 1,
    "resolution": 86400,
    "dailyChange": "155.85",
    "dailyHigh": "6167.15",
    "dailyLow": "6011.3",
    "dailyVolume": "418693670.8",
    "data": [
      {
        "date": 1533513600000,
        "value": "6045.34"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none line
payload object false none none
» trading_pair_id integer false none none
» resolution integer false none none
» dailyChange string false none none
» dailyHigh string false none none
» dailyLow string false none none
» dailyVolume string false none none
» data [object] false none none
»» date integer false none UTC timestamp of the trade, in milliseconds
»» value string false none none

WebsocketOrderBook

{
  "message_type": "order_book",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "bids": [
          {
            "price": "6043.23",
            "amount": "2.5510545",
            "value": "15417.19"
          }
        ],
        "asks": [
          {
            "price": "6044.1",
            "amount": "4.81763208",
            "value": "29118.25"
          }
        ]
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none order_book
payload object false none none
» trading_pair_id integer false none none
» data [object] false none none
»» bids [object] false none none
»»» price string false none none
»»» amount string false none none
»»» value string false none none
»» asks [object] false none none
»»» price string false none none
»»» amount string false none none
»»» value string false none none

WebsocketTrades

{
  "message_type": "trades",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "price": "6045.37",
        "amount": "0.48216109",
        "time": 1533553731493
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none trades
payload object false none none
» trading_pair_id integer false none none
» data [object] false none none
»» price string false none none
»» amount string false none none
»» time integer false none none

WebsocketTicker

{
  "message_type": "ticker",
  "payload": {
    "trading_pair_id": 1,
    "data": [
      {
        "ask_price": "6045.72",
        "bid_price": "6044.69",
        "last_price": "6045.72",
        "volume": "string"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none ticker
payload object false none none
» trading_pair_id integer false none none
» data [object] false none none
»» ask_price string|null false none none
»» bid_price string|null false none none
»» last_price string|null false none none
»» volume string|null false none 24h volume

WebsocketPortfolio

{
  "message_type": "portfolio",
  "payload": {
    "data": [
      {
        "id": 916,
        "assets": [
          {
            "trading_asset_id": 2,
            "available_amount": "24990.00",
            "reserved_amount": "24990.00",
            "wallet_address": "11111111-1111-1111-1111-111111111111"
          }
        ]
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none portfolio
payload object false none none
» data [object] false none none
»» id integer false none none
»» assets [object] false none none
»»» trading_asset_id id false none none
»»» available_amount string false none none
»»» reserved_amount string false none none
»»» wallet_address string false none this value is optional

WebsocketUserOrders

{
  "message_type": "user_orders",
  "payload": {
    "data": [
      {
        "id": 16575930,
        "portfolio_id": 1,
        "trading_pair_id": 1,
        "direction": "BUY",
        "type": "LIMIT",
        "amount": "0.1",
        "remaining_amount": "0.05",
        "price": "100",
        "time_in_force": "GTC",
        "stop_price": null,
        "date": 1533555163180,
        "status": "PARTIALLY_FILLED",
        "trades": [
          {
            "amount": "0.05",
            "price": "100",
            "time": 1533555164180
          }
        ]
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
message_type string false none user_orders
payload object false none none
» data [object] false none none
»» id integer false none none
»» portfolio_id integer false none none
»» trading_pair_id integer false none none
»» direction string false none none
»» type string false none none
»» amount string false none none
»» remaining_amount string false none none
»» price string false none none
»» time_in_force string|null false none none
»» stop_price string|null false none none
»» date integer false none UTC timestamp of the trade, in milliseconds
»» status string false none none
»» trades [object] false none none
»»» amount string false none Amount of traded assets, number as string
»»» price string false none Price for one unit of asset
»»» time integer false none none