NAV Navigation

BLADE WebSocket API v0.1.0.21

Scroll down for example requests and responses.

The BLADE WebSocket API is a pure WebSocket API protocol.

To request API access, please email api-access@blade.exchange.

Introduction

Connecting to the BLADE WebSocket API

Connect to the BLADE WebSocket API via the path below. Authentication is required for all connections. See the Authentication section for more details.

wss://[BLADE_API_DOMAIN]/ws/api/websocket

Terminology

Architecture

The BLADE WebSocket API is organized into two categories: streaming vs non-streaming channels. Since the BLADE WebSocket API is a pure WebSocket API, a new socket must always be opened first before interacting with the API.

Currently, there are no public API endpoints and every request must be authenicated.

Streaming Channels

All streaming messages are received via specific channels. An acknowledgement message (response) is sent when joining the channel, but all subsequent streamed messages are fully asynchronous. For example, orders update messages stream through the orders channel topic:

  1. Open a WebSocket.
  2. Join the orders channel.
  3. Receive an acknowledgment message that the channel was succesfully joined.
  4. update_order messages will begin stream through the channel.

Non-Streaming Channels

All non-streaming actions are initiated through "management" or "fetch" channels. These channel names will always be prefixed with manage_ or fetch_. Unlike REST over HTTP, WebSocket is not a request-response protocol. To emulate request-response semantics, the server will reply with an immediate acknowledgment message (response) for all client messages.

Each client message should contain a ref field, whose value is unique for each message in any given connection. The ref value can be a monotonically increasing integer or a UUID. The response message's ref value will match the request message's ref value.

For example, to create an order:

  1. Open a WebSocket. (The same WebSocket may be reused across different channels.)
  2. Send a message to join the manage_orders channel. e.g.:

"topic": "manage_orders", "type": "join_channel", "ref": 1

  1. Receive an response message that the join was successful. e.g.:

"topic": "manage_orders", "status": "ok", "ref": 1

  1. Send a create_order message via the manage_orders channel. Set the ref as 2. e.g.:

"topic": "manage_orders", "type": "create_order", "ref": 2, "payload": { "symbol": "BTC-USD.PPL.INV", "quantity": "10", "type": "market"

  1. Receive a response message that the create order was successful. The ref field's value 2 matches the value from the create_order request. The payload field represents the newly created order. e.g.:

"topic": "manage_orders", "status": "ok", "ref": 2, "payload": { "id": "99b1780c-d318-11e8-8f09-600308a3845a", ...

Heartbeats

The BLADE WebSocket API will disconnect idle WebSockets after 60 seconds of inactivity. Send a heartbeat to keep the WebSocket connection alive.

See Manage Connection > heartbeat for the exact request / response steps.

Rate Limits

Changelog

0.1.0.21 (2019-10-08)

0.1.0.20 (2019-09-30)

0.1.0.19 (2019-09-26)

0.1.0.18 (2019-09-25)

0.1.0.17 (2019-07-31)

0.1.0.16 (2019-05-28)

0.1.0.15 (2019-02-05)

0.1.0.14 (2019-01-29)

0.1.0.13 (2018-12-09)

0.1.0.12 (2018-12-06)

0.1.0.11 (2018-12-05)

0.1.0.10 (2018-12-03)

0.1.0.9 (2018-11-25)

0.1.0

Authentication

Authentication is required for all WebSocket endpoints. Authenicate when the WebSocket is opened, during the initial WebSocket upgrade request. All authenication params are passed via query string.

API Key Auth (ApiKeyAuth)

Store API Key + API Secret on the Client

Create an api_key / api_secret pair from the Account page. The api_secret will be displayed only once when initially creating the pair from the Account page. If the api_secret is lost, create a new api_key / api_secret pair.

Sign and Open a WebSocket Connection

// javascript example

const crypto = require('crypto-js')

const api_key = '...'
const api_secret = '...'

const api_expires = 1234134 // Unix timestamp in seconds, 5 seconds in the future
const api_payload = 'AUTH' + api_expires
const api_signature = crypto
  .HmacSHA384(api_payload, api_secret)
  .toString(crypto.enc.Hex)
const query_string = 'api_key=' + api_key +
                     '&api_signature=' + api_signature +
                     '&api_payload=' + api_payload

// wss://[DOMAIN]/ws/api/websocket?api_key=_&api_signature=_&api_payload=_
wss.connect('wss://[DOMAIN]/ws/api/websocket?' + query_string)
  1. Provide the following values for the query string:
  1. Open a WebSocket Connection:

Open a WebSocket connection using the following URL. Use the values from the previous step in the query string.

wss://[DOMAIN]/ws/api/websocket?api_key=_&api_signature=_&api_payload=_

Streaming Channels

Stream Order Book

join stream_order_book_level_2 channel

Subscribe to the stream_order_book_level_2:[instrument_symbol] data stream.

Body parameter

{
  "topic": "stream_order_book_level_2:BTC-USD.PPL.INV",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body OrderBookL2Request true none

Example responses

200 Response

{
  "topic": "stream_order_book_level_2:BTC-USD.PPL.INV",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined stream_order_book_level_2:[instrument_symbol] channel confirmation. OrderBookL2Response

Streaming Data

snapshot

The latest snapshot of the Order Book. Upon connecting to the stream_order_book_level_2:[instrument_symbol] channel, a single snapshot messsage will be sent over the channel.

snapshot Payload

{
  "topic": "stream_order_book_level_2:BTC-USD.PPL.INV",
  "type": "snapshot_order_book_level_2",
  "payload": {
    "order_book_level_2": {
      "symbol": "BTC-USD.PPL.INV",
      "timestamp": "2019-10-09T19:53:49Z",
      "sequence": "1234",
      "buys": [
        [
          "4500.0",
          "10"
        ]
      ],
      "sells": [
        [
          "5500.0",
          "20"
        ]
      ]
    }
  }
}

Parameters

Parameter In Type Required Description
body body OrderBookL2Snapshot true none

update

The streaming updates of the Order Book. Upon connecting to the stream_order_book_level_2:[instrument_symbol] channel, multiple update messsages will be sent over the channel.

update Payload

{
  "topic": "stream_order_book_level_2:BTC-USD.PPL.INV",
  "type": "update_order_book_level_2",
  "payload": {
    "order_book_level_2_update": {
      "symbol": "BTC-USD.PPL.INV",
      "timestamp": "2019-10-09T19:53:49Z",
      "sequence": "1234",
      "buys": [
        [
          "4500.0",
          "10"
        ]
      ],
      "sells": [
        [
          "5500.0",
          "0"
        ]
      ]
    }
  }
}

Parameters

Parameter In Type Required Description
body body OrderBookL2Update true none

Stream Orders

join stream_orders channel

Subscribe to your private acccount's orders data stream. Your user_id must be passed as the subtopic (see Manage Account > get_account_info).

Body parameter

{
  "topic": "stream_orders:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body StreamOrdersRequest true none

Example responses

200 Response

{
  "topic": "stream_orders:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined stream_orders channel confirmation. StreamOrdersRequest

Streaming Data

update_order

The streaming updates of your account's orders. Order updates across all instruments are streamed.

Cancel Reason

An order may be cancelled for a variety of reasons. The cancel_reason field will contain one of the following values.

update_order Payload

{
  "topic": "stream_orders:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "update_order",
  "payload": {
    "orders": [
      {
        "id": "99b1780c-d318-11e8-8f09-600308a3845a",
        "fillable_quantity": "10",
        "price": "5000.00",
        "quantity": "10",
        "side": "buy",
        "symbol": "BTC-USD.PPL.INV",
        "state": "active",
        "cancel_reason": null,
        "time_in_force": "GTT",
        "type": "limit",
        "updated_at": "2019-10-09T19:53:49Z",
        "valid_until": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Parameters

Parameter In Type Required Description
body body OrdersUpdate true none

Stream Positions

join stream_positions channel

Subscribe to the stream_positions updates stream. Your user_id must be passed as the subtopic (see Manage Account > get_account_info).

Body parameter

{
  "topic": "stream_positions:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body StreamPositionsRequest true none

Example responses

200 Response

{
  "topic": "stream_positions:8283851c-d875-40c4-b05b-4299be141ff7",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined stream_positions channel confirmation. StreamPositionsResponse

Streaming Data

update_position

The streaming updates of your account's positions. Position updates across all instruments are streamed.

update_position Payload

{
  "topic": "stream_positions:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "update_position",
  "payload": {
    "positions": [
      {
        "symbol": "BTC-USD.PPL.INV",
        "size": "10",
        "leverage": "10",
        "margin_type": "isolated",
        "liquidation_price": "4000.00"
      }
    ]
  }
}

Parameters

Parameter In Type Required Description
body body PositionsUpdate true none

Stream Trades

join stream_trades channel

Subscribe to the stream_trades:[instrument_symbol] updates stream.

Body parameter

{
  "topic": "stream_trades:BTC-USD.PPL.INV",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body StreamTradesRequest true none

Example responses

200 Response

{
  "topic": "stream_trades:BTC-USD.PPL.INV",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined trades channel confirmation. StreamTradesResponse

Streaming Data

update_trades

The streaming updates of trades for the given instrument_symbol.

update_trades Payload

{
  "topic": "stream_trades:BTC-USD.PPL.INV",
  "type": "update_trades",
  "payload": {
    "trades": [
      {
        "id": "3cc6ef4c-b88e-4368-b320-64c16fc703ae",
        "symbol": "BTC-USD.PPL.INV",
        "side": "buy",
        "quantity": "20",
        "price": "5002.50",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Parameters

Parameter In Type Required Description
body body TradesUpdate true none

Stream Fills

join stream_fills channel

Subscribe to the stream_fills updates stream. Your user_id must be passed as the subtopic (see Manage Account > get_account_info).

Body parameter

{
  "topic": "stream_fills:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body StreamFillsRequest true none

Example responses

200 Response

{
  "topic": "stream_fills:8283851c-d875-40c4-b05b-4299be141ff7",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined stream_fills channel confirmation. StreamFillsResponse

Streaming Data

update_fill

The streaming updates of your account's fills. Fills across all instruments are streamed.

update_fill Payload

{
  "topic": "stream_fills:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "update_fill",
  "payload": {
    "fills": [
      {
        "id": "c97ac164-e8cf-410f-9ccf-53a590b0143f",
        "type": "maker",
        "quantity": "20",
        "price": "5002.50",
        "order_id": "7e5808d4-d4e8-4171-8ecb-30b26096c371",
        "symbol": "BTC-USD.PPL.INV",
        "fee_amount": "-0.00000123",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Parameters

Parameter In Type Required Description
body body FillsUpdate true none

Stream Tickers

join stream_ticker channel

Subscribe to the stream_ticker:[symbol] data stream.

Body parameter

{
  "topic": "stream_ticker:BTC-USD.CSH.INDEX-001",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body StreamTickerRequest true none

Example responses

200 Response

{
  "topic": "stream_ticker:BTC-USD.CSH.INDEX-001",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined stream_ticker:[symbol] channel confirmation. StreamTickerResponse

Streaming Data

update_ticker

The streaming updates for a ticker.

update_ticker Payload

{
  "topic": "stream_ticker:BTC-USD.CSH.INDEX-001",
  "type": "update_ticker",
  "payload": {
    "tickers": [
      {
        "symbol": "BTC-USD.CSH.INDEX-001",
        "price": "5000.00",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Parameters

Parameter In Type Required Description
body body TickerUpdate true none

Stream Liquidations

For streaming liquidations belonging to the authenticated user.

join stream_liquidations channel

Subscribe to the stream_liquidations updates stream. Your user_id must be passed as the subtopic (see Manage Account > get_account_info).

Body parameter

{
  "topic": "stream_liquidations:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body StreamLiquidationsRequest true none

Example responses

200 Response

{
  "topic": "stream_liquidations:8283851c-d875-40c4-b05b-4299be141ff7",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined stream_liquidations channel confirmation. StreamLiquidationsResponse

Streaming Data

create_liquidation

The streaming creation of your account's position liquidations. Liquidations across all instruments are streamed.

create_liquidation Payload

{
  "topic": "stream_liquidations:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "create_liquidation",
  "payload": {
    "liquidations": [
      {
        "id": "5d838268-b4b6-451d-915e-5e81ff57bcff",
        "symbol": "BTC-USD.PPL.INV",
        "liquidated_position_type": "long",
        "liquidated_position_margin_type": "isolated",
        "liquidated_position_leverage": "50.0",
        "liquidated_position_quantity": "2000",
        "liquidated_position_liquidation_price": "6127.08",
        "mark_price": "6126.99",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Parameters

Parameter In Type Required Description
body body LiquidationCreate true none

Stream Terminations

For streaming terminations belonging to the authenticated user.

join stream_terminations channel

Subscribe to the stream_terminations updates stream. Your user_id must be passed as the subtopic (see Manage Account > get_account_info).

Body parameter

{
  "topic": "stream_terminations:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body StreamTerminationsRequest true none

Example responses

200 Response

{
  "topic": "stream_terminations:8283851c-d875-40c4-b05b-4299be141ff7",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined stream_terminations channel confirmation. StreamTerminationsResponse

Streaming Data

create_termination

The streaming creation of your account's position terminations. Terminations across all instruments are streamed.

create_termination Payload

{
  "topic": "stream_terminations:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "create_termination",
  "payload": {
    "terminations": [
      {
        "id": "5b574d7a-5e06-4c97-a128-985e3508bcb7",
        "symbol": "BTC-USD.PPL.INV",
        "terminated_quantity": "1500",
        "terminated_position_entry_price": "6250.00",
        "terminated_position_quantity": "2000",
        "terminated_position_type": "short",
        "terminated_position_margin_type": "isolated",
        "terminated_position_leverage": "10.0",
        "termination_price": "6107.25",
        "realized_profit": "0.01000000",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Parameters

Parameter In Type Required Description
body body TerminationCreate true none

Management Channels

Manage Account

For managing accounts, connect to a socket, and then join the manage_account channel.

join manage_account channel

Join manage_account channel.

Body parameter

{
  "topic": "manage_account",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body ManageAccountRequest true none

Example responses

200 Response

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined manage_account channel confirmation. ManageAccountResponse

get_account_info

Get account info (user id and email address)

Body parameter

{
  "topic": "manage_account",
  "type": "get_account_info",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body GetAccountInfoRequest true none

Example responses

200 Response

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "account_info": {
      "user_id": "8283851c-d875-40c4-b05b-4299be141ff7",
      "email": "trader@example.com"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Account info. GetAccountInfoResponse

list_wallets

List all wallets.

Body parameter

{
  "topic": "manage_account",
  "type": "list_wallets",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body ListWalletsRequest true none

Example responses

200 Response

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "wallets": [
      {
        "currency_symbol": "BTC",
        "cash_balance": "1.5",
        "available_cash_balance": "1.0",
        "trading_balance": "3.0",
        "earmarked_for_withdrawal": "0.5",
        "pending_withdrawal": "0.3"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK List of wallets with cash and trading balances. ListWalletsResponse

get_deposit_address

Get deposit address for a given currency.

Body parameter

{
  "topic": "manage_account",
  "type": "get_deposit_address",
  "ref": 1,
  "payload": {
    "currency_symbol": "BTC"
  }
}

Parameters

Parameter In Type Required Description
body body GetDepositAddressRequest true none

Example responses

200 Response

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "deposit_address": {
      "currency_symbol": "BTC",
      "address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Current deposit address. GetDepositAddressResponse

withdraw_funds

Create request to withdraw crypto funds from a cash wallet.

Body parameter

{
  "topic": "manage_account",
  "type": "withdraw_funds",
  "ref": 1,
  "payload": {
    "currency_symbol": "BTC",
    "amount": "1.5",
    "destination_address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN9"
  }
}

Parameters

Parameter In Type Required Description
body body WithdrawFundsRequest true none

Example responses

200 Response

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "withdrawal": {
      "id": "79a267f4-d333-11e8-a6eb-600308a3845a",
      "currency_symbol": "BTC",
      "destination_address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
      "amount": "1.5",
      "state": "pending"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Withdraw crypto funds request confirmation. WithdrawFundsResponse

transfer_funds

Transfer funds between cash and trading wallet.

Body parameter

{
  "topic": "manage_account",
  "type": "transfer_funds",
  "ref": 1,
  "payload": {
    "currency_symbol": "BTC",
    "amount": "1.50000000",
    "transfer_type": "cash_to_trading"
  }
}

Parameters

Parameter In Type Required Description
body body TransferFundsRequest true none

Example responses

200 Response

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "transfer": {
      "id": "79a267f4-d333-11e8-a6eb-600308a3845a",
      "currency_symbol": "BTC",
      "amount": "1.50000000",
      "transfer_type": "cash_to_trading",
      "timestamp": "2019-10-09T19:53:49Z"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Transfer confirmation. TransferFundsResponse

list_transfers

List all tranfers for an account, given a specific collateral currency. Transfers currently include only trading_balance_deposit and withdrawal transfers. Currently only returns the most recent 100 transfers.

Transfer Types

Coming Soon

Body parameter

{
  "topic": "manage_account",
  "type": "list_transfers",
  "ref": 1,
  "payload": {
    "currency_symbol": "BTC"
  }
}

Parameters

Parameter In Type Required Description
body body ListTransfersRequest true none

Example responses

200 Response

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "transfers": [
      {
        "id": "99b1780c-d318-11e8-8f09-600308a3845a",
        "currency_symbol": "BTC",
        "amount": "0.7",
        "type": "trading_balance_deposit",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK List of at most 100 transfers. ListTransfersResponse

Manage Positions

For managing positions, connect to a socket, and then join the manage_positions channel.

join manage_positions channel

Join manage_positions channel.

Body parameter

{
  "topic": "manage_positions",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body ManagePositionsRequest true none

Example responses

200 Response

{
  "topic": "manage_positions",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined manage_positions channel confirmation. ManagePositionsResponse

list_positions

List all positions.

Body parameter

{
  "topic": "manage_positions",
  "type": "list_positions",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body ListPositionsRequest true none

Example responses

200 Response

{
  "topic": "manage_positions",
  "status": "ok",
  "ref": 1,
  "payload": {
    "positions": [
      {
        "symbol": "BTC-USD.PPL.INV",
        "size": "10.00",
        "entry_value": "0.00200000",
        "entry_price": "5000.00",
        "leverage": "10",
        "margin_type": "isolated",
        "margin": "0.00020000",
        "liquidation_price": "4000.00"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK List of all positions. ListPositionsResponse

update_position_leverage

Update position leverage and margin_type.

Body parameter

{
  "topic": "manage_position",
  "type": "update_position_leverage",
  "ref": 1,
  "payload": {
    "symbol": "BTC-USD.PPL.INV",
    "margin_type": "cross",
    "leverage": null
  }
}

Parameters

Parameter In Type Required Description
body body UpdatePositionLeverageRequest true none

Example responses

200 Response

{
  "topic": "manage_positions",
  "status": "ok",
  "ref": 1,
  "payload": {
    "position": {
      "symbol": "BTC-USD.PPL.INV",
      "size": "10",
      "leverage": null,
      "margin_type": "cross",
      "liquidation_price": "4000.00"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Updated position with new leverage. UpdatePositionLeverageResponse

list_recent_liquidations

List recent liquidations

Body parameter

{
  "topic": "manage_positions",
  "type": "list_recent_liquidations",
  "ref": 1,
  "payload": {
    "count": "10"
  }
}

Parameters

Parameter In Type Required Description
body body ListRecentLiquidationsRequest true none

Example responses

200 Response

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "liquidations": [
      {
        "id": "5d838268-b4b6-451d-915e-5e81ff57bcff",
        "symbol": "BTC-USD.PPL.INV",
        "liquidated_position_type": "long",
        "liquidated_position_margin_type": "isolated",
        "liquidated_position_leverage": "50.0",
        "liquidated_position_quantity": "2000",
        "liquidated_position_liquidation_price": "6127.08",
        "mark_price": "6126.99",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK List of recent liquidations. ListRecentLiquidationsResponse

list_recent_terminations

List recent terminations

Body parameter

{
  "topic": "manage_positions",
  "type": "list_recent_terminations",
  "ref": 1,
  "payload": {
    "count": "10"
  }
}

Parameters

Parameter In Type Required Description
body body ListRecentTerminationsRequest true none

Example responses

200 Response

{
  "topic": "manage_positions",
  "status": "ok",
  "ref": 1,
  "payload": {
    "terminations": [
      {
        "id": "5b574d7a-5e06-4c97-a128-985e3508bcb7",
        "symbol": "BTC-USD.PPL.INV",
        "terminated_quantity": "1500",
        "terminated_position_entry_price": "6250.00",
        "terminated_position_quantity": "2000",
        "terminated_position_type": "short",
        "terminated_position_margin_type": "isolated",
        "terminated_position_leverage": "10.0",
        "termination_price": "6107.25",
        "realized_profit": "0.01000000",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK List of recent terminations. ListRecentTerminationsResponse

Manage Orders

For managing orders, connect to a socket, and then join the manage_orders channel.

join manage_orders channel

Join manage_orders channel.

Body parameter

{
  "topic": "manage_orders",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body ManageOrdersRequest true none

Example responses

200 Response

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined manage_orders channel confirmation. ManageOrdersResponse

create_order

Create an Order.

Body parameter

Market Order

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "quantity": "10",
    "side": "buy",
    "symbol": "BTC-USD.PPL.INV",
    "type": "market"
  }
}

Parameters

Parameter In Type Required Description
body body CreateOrderRequest true none

Example responses

Market Order

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "order": {
      "id": "99b1780c-d318-11e8-8f09-600308a3845a",
      "fillable_quantity": "10",
      "quantity": "10",
      "side": "buy",
      "symbol": "BTC-USD.PPL.INV",
      "state": "pending",
      "type": "market",
      "updated_at": "2018-11-12T23:56:53Z"
    }
  }
}

Limit Order

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "order": {
      "id": "99b1780c-d318-11e8-8f09-600308a3845a",
      "fillable_quantity": "10",
      "price": "5000.00",
      "quantity": "10",
      "side": "sell",
      "symbol": "BTC-USD.PPL.INV",
      "state": "pending",
      "time_in_force": "GTT",
      "type": "limit",
      "updated_at": "2018-11-12T23:56:53Z",
      "valid_until": "2018-11-13T23:56:53Z",
      "post_only": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Created order. CreateOrderResponse

cancel_order

Cancel an Order.

Body parameter

{
  "topic": "manage_orders",
  "type": "cancel_order",
  "ref": 1,
  "payload": {
    "symbol": "BTC-USD.PPL.INV",
    "order_id": "79a267f4-d333-11e8-a6eb-600308a3845a"
  }
}

Parameters

Parameter In Type Required Description
body body CancelOrderRequest true none

Example responses

200 Response

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "order": {
      "id": "99b1780c-d318-11e8-8f09-600308a3845a",
      "fillable_quantity": "10",
      "price": "5000.00",
      "quantity": "10",
      "side": "buy",
      "symbol": "BTC-USD.PPL.INV",
      "state": "active",
      "time_in_force": "GTC",
      "type": "limit",
      "updated_at": "2019-10-09T19:53:49Z",
      "valid_until": null
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Cancel order request confirmation. CancelOrderResponse

cancel_open_orders_after

Starts a process to cancel all open orders after duration_in_msec milliseconds has elapsed. The process can be stopped by setting duration_in_msec to 0.

This functionality can be used to automatically cancel all open orders if connection to the exchange is lost. For instance, if a client periodically issues a request to cancel open orders 60 seconds in the future, then all open orders placed by the client will be cancelled if the client is disconnected for more than 60 seconds.

Note: Open orders across all products will be cancelled.

Body parameter

{
  "topic": "manage_orders",
  "type": "cancel_open_orders_after",
  "ref": 1,
  "payload": {
    "duration_in_msec": "60000"
  }
}

Parameters

Parameter In Type Required Description
body body CancelOpenOrdersAfterRequest true none

Example responses

200 Response

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "requested_at": "2019-09-25T07:40:24.071724Z",
    "cancel_orders_at": "2019-09-25T07:41:24.071724Z",
    "duration_in_msec": "60000"
  }
}

Responses

Status Meaning Description Schema
200 OK Cancel open orders process summary CancelOpenOrdersAfterResponse

list_open_orders

List all open orders. Both pending and active orders are returned. A pending order indicates the order has been created, but is not yet on the the order book (for limit orders) or matched yet (for market orders or matchable limit orders).

Body parameter

{
  "topic": "manage_orders",
  "type": "list_open_orders",
  "ref": 1,
  "payload": {
    "symbol": "BTC-USD.PPL.INV"
  }
}

Parameters

Parameter In Type Required Description
body body ListOpenOrdersRequest true none

Example responses

200 Response

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "orders": [
      {
        "id": "99b1780c-d318-11e8-8f09-600308a3845a",
        "fillable_quantity": "10",
        "price": "5000.00",
        "quantity": "10",
        "side": "buy",
        "symbol": "BTC-USD.PPL.INV",
        "state": "active",
        "time_in_force": "GTT",
        "type": "limit",
        "updated_at": "2019-10-09T19:53:49Z",
        "valid_until": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK List of all open orders. ListOpenOrdersResponse

list_recent_fills

List your recent fills sorted in reverse chronological order on the given instrument.

Body parameter

{
  "topic": "manage_orders",
  "type": "list_recent_fills",
  "ref": 1,
  "payload": {
    "count": "100",
    "symbol": "BTC-USD.PPL.INV"
  }
}

Parameters

Parameter In Type Required Description
body body ListRecentFillsRequest true none

Example responses

200 Response

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "fills": [
      {
        "id": "c97ac164-e8cf-410f-9ccf-53a590b0143f",
        "type": "maker",
        "quantity": "20",
        "price": "5002.50",
        "order_id": "7e5808d4-d4e8-4171-8ecb-30b26096c371",
        "symbol": "BTC-USD.PPL.INV",
        "fee_amount": "-0.00000123",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK List of requested fills. ListRecentFillsResponse

Manage Connection

The manage_connection channel is implicitly joined when the socket is opened, so there is no need to explicitly join the manage_connection channel.

heartbeat

Send a heartbeat to keep the WebSocket connection alive. The BLADE WebSocket API will disconnect idle WebSockets after 60 seconds of inactivity. To keep the connection open, take the following steps:

  1. Issue a heartbeat message to the manage_connection channel every 30 seconds.
  2. Expect a reply with status ok.
  3. If no reply with status ok is received within 5 seconds, throw an error or reconnect.

Note: The manage_connection channel is implicitly joined when the WebSocket is opened, so there is no need to issue a join_channel request first.

Body parameter

{
  "topic": "manage_connection",
  "type": "heartbeat",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body HeartbeatRequest true none

Example responses

200 Response

{
  "topic": "manage_connection",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Heartbeat confirmation. HeartbeatResponse

Fetch Exchange Info

join fetch_exchange_info channel

Join fetch_exchange_info channel.

Body parameter

{
  "topic": "fetch_exchange_info",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body FetchExchangeInfoRequest true none

Example responses

200 Response

{
  "topic": "fetch_exchange_info",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined fetch_exchange_info channel confirmation. FetchExchangeInfoResponse

list_currencies

List currencies.

Body parameter

{
  "topic": "fetch_exchange_info",
  "type": "list_currencies",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body ListCurrenciesRequest true none

Example responses

200 Response

{
  "topic": "fetch_exchange_info",
  "status": "ok",
  "ref": 1,
  "payload": {
    "currencies": [
      {
        "symbol": "BTC",
        "name": "Bitcoin",
        "precision": 8,
        "withdrawal_fee": "0.00050000"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Synchronous response of currencies ListCurrenciesResponse

list_instruments

List instruments.

Body parameter

{
  "topic": "fetch_exchange_info",
  "type": "list_instruments",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body ListInstrumentsRequest true none

Example responses

200 Response

{
  "topic": "fetch_exchange_info",
  "status": "ok",
  "ref": 1,
  "payload": {
    "instruments": [
      {
        "symbol": "BTC-USD.PPL.INV",
        "underlying_currency_symbol": "BTC",
        "quote_currency_symbol": "USD",
        "collateral_currency_symbol": "BTC",
        "contract_size": "1.00",
        "tick_size": "0.01"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Synchronous response of instruments ListInstrumentsResponse

Fetch Trades

join fetch_trades channel

Join fetch_trades channel.

Body parameter

{
  "topic": "fetch_trades",
  "type": "join_channel",
  "ref": 1
}

Parameters

Parameter In Type Required Description
body body FetchTradesRequest true none

Example responses

200 Response

{
  "topic": "fetch_trades",
  "status": "ok",
  "ref": 1
}

Responses

Status Meaning Description Schema
200 OK Joined fetch_trades channel confirmation. FetchTradesResponse

list_recent_trades

List recent trades.

Body parameter

{
  "topic": "fetch_trades",
  "type": "list_recent_trades",
  "ref": 1,
  "payload": {
    "symbol": "BTC-USD.PPL.INV",
    "count": "100"
  }
}

Parameters

Parameter In Type Required Description
body body ListRecentTradesRequest true none

Example responses

200 Response

{
  "topic": "fetch_trades",
  "status": "ok",
  "ref": 1,
  "payload": {
    "trades": [
      {
        "id": "3cc6ef4c-b88e-4368-b320-64c16fc703ae",
        "symbol": "BTC-USD.PPL.INV",
        "side": "buy",
        "quantity": "20",
        "price": "5002.50",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Synchronous response of currencies ListRecentTradesResponse

Schemas

OrderBookL2Request

{
  "topic": "stream_order_book_level_2:BTC-USD.PPL.INV",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_order_book_level_2:[instrument_symbol].
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
type join_channel

OrderBookL2Response

{
  "topic": "stream_order_book_level_2:BTC-USD.PPL.INV",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_order_book_level_2:[instrument_symbol].
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
status ok

OrderBookL2Snapshot

{
  "topic": "stream_order_book_level_2:BTC-USD.PPL.INV",
  "type": "snapshot_order_book_level_2",
  "payload": {
    "order_book_level_2": {
      "symbol": "BTC-USD.PPL.INV",
      "timestamp": "2019-10-09T19:53:49Z",
      "sequence": "1234",
      "buys": [
        [
          "4500.0",
          "10"
        ]
      ],
      "sells": [
        [
          "5500.0",
          "20"
        ]
      ]
    }
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_order_book_level_2:[instrument_symbol].
type string true none The type of message. Always snapshot_order_book_level_2.
payload object true none none
» order_book_level_2 object true none State of the order book for the given timestamp/sequence.
»» symbol string true none The instrument symbol.
»» timestamp string(date-time) true none Time at which the orderbook change to this state.
»» sequence string true none Monotonically increasing integer representing the state of the order book.
»» buys [string] true none Array of [price, quantity].
»» sells [string] true none Array of [price, quantity].

Enumerated Values

Property Value
type snapshot_order_book_level_2

OrderBookL2Update

{
  "topic": "stream_order_book_level_2:BTC-USD.PPL.INV",
  "type": "update_order_book_level_2",
  "payload": {
    "order_book_level_2_update": {
      "symbol": "BTC-USD.PPL.INV",
      "timestamp": "2019-10-09T19:53:49Z",
      "sequence": "1234",
      "buys": [
        [
          "4500.0",
          "10"
        ]
      ],
      "sells": [
        [
          "5500.0",
          "0"
        ]
      ]
    }
  }
}

Properties

Name Type Required Restrictions Description
topic string false none The channel topic. Always stream_order_book_level_2:[instrument_symbol].
type string false none The type of message. Always update_order_book_level_2.
payload object false none none
» order_book_level_2_update object true none Updates to the order book state. Only prices that have changed will be present with the new quantity (not delta).
»» symbol string true none The instrument symbol.
»» timestamp string(date-time) true none Time at which the orderbook change to this state.
»» sequence string true none Monotonically increasing integer representing the state of the order book.
»» buys [string] true none Array of [price, quantity]. Zero quantity will only appear in this order_book_level_2_update payload.
»» sells [string] true none Array of [price, quantity]. Zero quantity will only appear in this order_book_level_2_update payload.

Enumerated Values

Property Value
type update_order_book_level_2

StreamOrdersRequest

{
  "topic": "stream_orders:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_orders:[your_user_id].
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
type join_channel

StreamOrdersResponse

{
  "topic": "stream_orders:8283851c-d875-40c4-b05b-4299be141ff7",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_orders:[your_user_id].
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
status ok

OrdersUpdate

{
  "topic": "stream_orders:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "update_order",
  "payload": {
    "orders": [
      {
        "id": "99b1780c-d318-11e8-8f09-600308a3845a",
        "fillable_quantity": "10",
        "price": "5000.00",
        "quantity": "10",
        "side": "buy",
        "symbol": "BTC-USD.PPL.INV",
        "state": "active",
        "cancel_reason": null,
        "time_in_force": "GTT",
        "type": "limit",
        "updated_at": "2019-10-09T19:53:49Z",
        "valid_until": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string false none The channel topic. Always stream_orders:[your_user_id].
type string false none The type of message.
payload object false none none
» orders [object] false none List of streamed updated orders.
»» id string false none The order ID.
»» fillable_quantity string false none The fillable quantity.
»» price string false none The order price, if set.
»» quantity string false none The requested quantity.
»» side string false none The order side.
»» symbol string false none The instrument symbol.
»» state string false none The order state. Will be pending for a new order.
»» cancel_reason string false none The reason an order was cancelled. Value will be null if order state is not cancelled.
»» time_in_force string false none The order time in force.
»» type string false none The order type.
»» updated_at string(date-time) false none Updated at timestamp.
»» valid_until string(date-time) false none Valid until timestamp for the order, if time_in_force = GTT.

Enumerated Values

Property Value
type update_order
side buy
side sell
state pending
state active
state done
state cancelled
cancel_reason user
cancel_reason insufficient_funds
cancel_reason liquidation
cancel_reason reduction
cancel_reason termination
cancel_reason post_only_match
cancel_reason market_no_match
cancel_reason self_match
cancel_reason stop_market_no_match
cancel_reason client_disconnected
cancel_reason system_overloaded
cancel_reason matching_engine_unavailable
cancel_reason unsuccessful_match
time_in_force GTC
time_in_force GTT
type limit
type market

StreamPositionsRequest

{
  "topic": "stream_positions:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_positions:[your_user_id].
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
type join_channel

StreamPositionsResponse

{
  "topic": "stream_positions:8283851c-d875-40c4-b05b-4299be141ff7",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_positions:[your_user_id].
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
status ok

PositionsUpdate

{
  "topic": "stream_positions:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "update_position",
  "payload": {
    "positions": [
      {
        "symbol": "BTC-USD.PPL.INV",
        "size": "10",
        "leverage": "10",
        "margin_type": "isolated",
        "liquidation_price": "4000.00"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string false none The channel topic. Always stream_positions:[your_user_id].
type string false none The type of message.
payload object false none none
» positions [object] false none List of streamed updated positions.
»» symbol string false none The instrument symbol.
»» size string false none The position size.
»» leverage string false none The position leverage, if margin_type = isolated. Will be null if margin_type = cross.
»» margin_type string false none The position margin type.
»» liquidation_price string false none The position liquidation price.

Enumerated Values

Property Value
type update_position
margin_type isolated
margin_type cross

StreamTickerRequest

{
  "topic": "stream_ticker:BTC-USD.CSH.INDEX-001",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_ticker:[symbol].
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
type join_channel

StreamTickerResponse

{
  "topic": "stream_ticker:BTC-USD.CSH.INDEX-001",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_ticker:[symbol].
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
status ok

TickerUpdate

{
  "topic": "stream_ticker:BTC-USD.CSH.INDEX-001",
  "type": "update_ticker",
  "payload": {
    "tickers": [
      {
        "symbol": "BTC-USD.CSH.INDEX-001",
        "price": "5000.00",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string false none The channel topic. Always stream_ticker:[symbol].
type string false none The type of message.
payload object false none none
» tickers [object] false none List of streamed updated tickers.
»» symbol string false none The ticker symbol.
»» price string false none The ticker price.
»» timestamp string(date-time) false none none

Enumerated Values

Property Value
type update_ticker

StreamTradesRequest

{
  "topic": "stream_trades:BTC-USD.PPL.INV",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_trades:[instrument_symbol].
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
type join_channel

StreamTradesResponse

{
  "topic": "stream_trades:BTC-USD.PPL.INV",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_trades:[instrument_symbol].
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
status ok

TradesUpdate

{
  "topic": "stream_trades:BTC-USD.PPL.INV",
  "type": "update_trades",
  "payload": {
    "trades": [
      {
        "id": "3cc6ef4c-b88e-4368-b320-64c16fc703ae",
        "symbol": "BTC-USD.PPL.INV",
        "side": "buy",
        "quantity": "20",
        "price": "5002.50",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string false none The channel topic. Always stream_trades:[instrument_symbol].
type string false none The type of message.
payload object false none none
» trades [object] false none List of streamed updated trades.
»» id string false none The id of the trade.
»» symbol string false none The instrument symbol.
»» side string false none The side of the order causing the trade.
»» quantity string false none The filled quantity.
»» price string false none The average price at which the quantity was filled.
»» timestamp string(date-time) false none The time at which the trade was executed.

Enumerated Values

Property Value
type update_trades
side buy
side sell

StreamFillsRequest

{
  "topic": "stream_fills:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_fills:[your_user_id].
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
type join_channel

StreamFillsResponse

{
  "topic": "stream_fills:8283851c-d875-40c4-b05b-4299be141ff7",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_fills:[your_user_id].
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
status ok

FillsUpdate

{
  "topic": "stream_fills:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "update_fill",
  "payload": {
    "fills": [
      {
        "id": "c97ac164-e8cf-410f-9ccf-53a590b0143f",
        "type": "maker",
        "quantity": "20",
        "price": "5002.50",
        "order_id": "7e5808d4-d4e8-4171-8ecb-30b26096c371",
        "symbol": "BTC-USD.PPL.INV",
        "fee_amount": "-0.00000123",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string false none The channel topic. Always stream_fills:[your_user_id].
type string false none The type of message.
payload object false none none
» fills [object] false none List of streamed updated fills.
»» id string false none The id of the fill.
»» type string false none Whether the order was filled as a maker or taker. (Same as whether the order was a maker or taker).
»» quantity string false none The filled quantity.
»» price string false none The price at which the quantity was filled. For a maker, the fill price is the same as the order price. For a taker, the fill price is the weighted average price of all orders with which the order was matched.
»» order_id string false none The id of the order that was filled.
»» symbol string false none The instrument symbol.
»» fee_amount string false none Taker fee or maker rebate (negative fee represents a maker rebate).
»» timestamp string(date-time) false none The time at which the order was filled.

Enumerated Values

Property Value
type update_fill
type maker
type taker

StreamLiquidationsRequest

{
  "topic": "stream_liquidations:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_liquidations:[your_user_id].
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
type join_channel

StreamLiquidationsResponse

{
  "topic": "stream_liquidations:8283851c-d875-40c4-b05b-4299be141ff7",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_liquidations:[your_user_id].
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
status ok

LiquidationCreate

{
  "topic": "stream_liquidations:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "create_liquidation",
  "payload": {
    "liquidations": [
      {
        "id": "5d838268-b4b6-451d-915e-5e81ff57bcff",
        "symbol": "BTC-USD.PPL.INV",
        "liquidated_position_type": "long",
        "liquidated_position_margin_type": "isolated",
        "liquidated_position_leverage": "50.0",
        "liquidated_position_quantity": "2000",
        "liquidated_position_liquidation_price": "6127.08",
        "mark_price": "6126.99",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string false none The channel topic. Always stream_liquidations:[your_user_id].
type string false none The type of message.
payload object false none none
» liquidations [object] false none List of streamed created liquidations.
»» id string false none The id of the liquidation.
»» symbol string false none The instrument symbol.
»» liquidated_position_type string false none Whether the liquidated position was long or short
»» liquidated_position_margin_type string false none The margin type of the liquidated position (isolated or cross).
»» liquidated_position_leverage string false none The leverage of the liquidated position.
»» liquidated_position_quantity string false none The number of contracts of the liquidated position.
»» liquidated_position_liquidation_price string false none The liquidation price of the liquidated position.
»» mark_price string false none The mark price at the time of liquidation.
»» timestamp string(date-time) false none The time of the liquidation.

Enumerated Values

Property Value
type create_liquidation
liquidated_position_type long
liquidated_position_type short
liquidated_position_margin_type isolated
liquidated_position_margin_type cross

StreamTerminationsRequest

{
  "topic": "stream_terminations:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_terminations:[your_user_id].
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
type join_channel

StreamTerminationsResponse

{
  "topic": "stream_terminations:8283851c-d875-40c4-b05b-4299be141ff7",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always stream_terminations:[your_user_id].
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
status ok

TerminationCreate

{
  "topic": "stream_terminations:8283851c-d875-40c4-b05b-4299be141ff7",
  "type": "create_termination",
  "payload": {
    "terminations": [
      {
        "id": "5b574d7a-5e06-4c97-a128-985e3508bcb7",
        "symbol": "BTC-USD.PPL.INV",
        "terminated_quantity": "1500",
        "terminated_position_entry_price": "6250.00",
        "terminated_position_quantity": "2000",
        "terminated_position_type": "short",
        "terminated_position_margin_type": "isolated",
        "terminated_position_leverage": "10.0",
        "termination_price": "6107.25",
        "realized_profit": "0.01000000",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string false none The channel topic. Always stream_terminations:[your_user_id].
type string false none The type of message.
payload object false none none
» terminations [object] false none List of streamed created terminations.
»» id string false none The id of the termination.
»» symbol string false none The instrument symbol.
»» terminated_quantity string false none Number of contracts terminated from the position. Always less than or equal to terminated_position_quantity.
»» terminated_position_entry_price string false none The entry price of the terminated position.
»» terminated_position_quantity string false none Total number of contracts in the terminated position.
»» terminated_position_type string false none Whether the terminated position was long or short.
»» terminated_position_margin_type string false none The margin type of the terminated position (isolated or cross).
»» terminated_position_leverage string false none The leverage of the terminated position.
»» termination_price string false none The price at which the position was terminated.
»» realized_profit string false none The profit realized from terminating the position at the termination price.
»» timestamp string(date-time) false none The time of the termination.

Enumerated Values

Property Value
type create_termination
terminated_position_type long
terminated_position_type short
terminated_position_margin_type isolated
terminated_position_margin_type cross

FetchExchangeInfoRequest

{
  "topic": "fetch_exchange_info",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_exchange_info.
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic fetch_exchange_info
type join_channel

FetchExchangeInfoResponse

{
  "topic": "fetch_exchange_info",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_exchange_info.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic fetch_exchange_info
status ok

ListCurrenciesRequest

{
  "topic": "fetch_exchange_info",
  "type": "list_currencies",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_exchange_info.
type string true none The type of request. Always list_currencies.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic fetch_exchange_info
type list_currencies

ListCurrenciesResponse

{
  "topic": "fetch_exchange_info",
  "status": "ok",
  "ref": 1,
  "payload": {
    "currencies": [
      {
        "symbol": "BTC",
        "name": "Bitcoin",
        "precision": 8,
        "withdrawal_fee": "0.00050000"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_exchange_info.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» currencies [object] true none List of all currencies.
»» symbol string false none The currency symbol.
»» name string false none The currency name.
»» precision integer false none The currency precision (max decimals).
»» withdrawal_fee string false none The withdrawal fee if the currency is a collateral currency, null otherwise.

Enumerated Values

Property Value
topic fetch_exchange_info
status ok

ListInstrumentsRequest

{
  "topic": "fetch_exchange_info",
  "type": "list_instruments",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_exchange_info.
type string true none The type of request. Always list_instruments.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic fetch_exchange_info
type list_instruments

ListInstrumentsResponse

{
  "topic": "fetch_exchange_info",
  "status": "ok",
  "ref": 1,
  "payload": {
    "instruments": [
      {
        "symbol": "BTC-USD.PPL.INV",
        "underlying_currency_symbol": "BTC",
        "quote_currency_symbol": "USD",
        "collateral_currency_symbol": "BTC",
        "contract_size": "1.00",
        "tick_size": "0.01"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_exchange_info.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» instruments [object] true none List of all available instruments.
»» symbol string false none The instrument symbol.
»» underlying_currency_symbol string false none The underlying currency symbol.
»» quote_currency_symbol string false none The quote currency symbol.
»» collateral_currency_symbol string false none The collateral currency symbol.
»» contract_size string false none The contract size.
»» tick_size string false none The tick size.

Enumerated Values

Property Value
topic fetch_exchange_info
status ok

FetchTradesRequest

{
  "topic": "fetch_trades",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_trades.
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic fetch_trades
type join_channel

FetchTradesResponse

{
  "topic": "fetch_trades",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_trades.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic fetch_trades
status ok

ListRecentTradesRequest

{
  "topic": "fetch_trades",
  "type": "list_recent_trades",
  "ref": 1,
  "payload": {
    "symbol": "BTC-USD.PPL.INV",
    "count": "100"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_trades.
type string true none The type of request. Always list_recent_trades.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» symbol string true none The instrument symbol.
» count string false none Max number of trades to return.

Enumerated Values

Property Value
topic fetch_trades
type list_recent_trades

ListRecentTradesResponse

{
  "topic": "fetch_trades",
  "status": "ok",
  "ref": 1,
  "payload": {
    "trades": [
      {
        "id": "3cc6ef4c-b88e-4368-b320-64c16fc703ae",
        "symbol": "BTC-USD.PPL.INV",
        "side": "buy",
        "quantity": "20",
        "price": "5002.50",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always fetch_trades.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» trades [object] false none List of streamed updated trades.
»» id string false none The id of the trade.
»» symbol string false none The instrument symbol.
»» side string false none The side of the order causing the trade.
»» quantity string false none The filled quantity.
»» price string false none The average price at which the quantity was filled.
»» timestamp string(date-time) false none The time at which the trade was executed.

Enumerated Values

Property Value
topic fetch_trades
status ok
side buy
side sell

ManageOrdersRequest

{
  "topic": "manage_orders",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_orders
type join_channel

ManageOrdersResponse

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_orders
status ok

CreateOrderRequest

{
  "topic": "manage_orders",
  "type": "create_order",
  "ref": 1,
  "payload": {
    "symbol": "BTC-USD.PPL.INV",
    "quantity": "10",
    "price": "5000.00",
    "side": "buy",
    "type": "limit",
    "time_in_force": "GTT",
    "valid_until": "2019-10-09T19:53:49Z",
    "post_only": false
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
type string true none The type of request. Always create_order.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» symbol string true none The instrument symbol.
» quantity string true none Number of contracts.
» price string false none Maximum price willing to enter per contract.
» side string true none The order side.
» type string true none Limit order or market order.
» time_in_force string false none Good Till Cancelled or Good Till Time (defaults to GTC).
» valid_until string(date-time) false none Expiration time of the order (required if GTT).
» post_only boolean|null false none If set to true, order will be cancelled if it would match any resting orders.

Enumerated Values

Property Value
topic manage_orders
type create_order
side buy
side sell
type limit
type market
time_in_force GTC
time_in_force GTT

CreateOrderResponse

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "order": {
      "id": "99b1780c-d318-11e8-8f09-600308a3845a",
      "fillable_quantity": "10",
      "price": "5000.00",
      "quantity": "10",
      "side": "buy",
      "symbol": "BTC-USD.PPL.INV",
      "state": "pending",
      "time_in_force": "GTT",
      "type": "limit",
      "updated_at": "2019-10-09T19:53:49Z",
      "valid_until": "2019-10-09T19:53:49Z",
      "post_only": false
    }
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» order object true none The new pending order.
»» id string false none The order ID.
»» fillable_quantity string false none The fillable quantity.
»» price string false none The order price, if set.
»» quantity string false none The requested quantity.
»» side string false none The order side.
»» symbol string false none The instrument symbol.
»» state string false none The order state. Will be pending for a new order.
»» time_in_force string false none The order time in force.
»» type string false none The order type.
»» updated_at string(date-time) false none Updated at timestamp.
»» valid_until string(date-time) false none Valid until timestamp for the order, if time_in_force = GTT.
»» post_only boolean|null false none If set to true, order will be cancelled if it would match any resting orders.

Enumerated Values

Property Value
topic manage_orders
status ok
side buy
side sell
state pending
state active
state done
state cancelled
time_in_force GTC
time_in_force GTT
type limit
type market

CancelOrderRequest

{
  "topic": "manage_orders",
  "type": "cancel_order",
  "ref": 1,
  "payload": {
    "symbol": "BTC-USD.PPL.INV",
    "order_id": "79a267f4-d333-11e8-a6eb-600308a3845a"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
type string true none The type of request. Always cancel_order.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» symbol string true none The instrument symbol.
» order_id string true none ID of order to be cancelled.

Enumerated Values

Property Value
topic manage_orders
type cancel_order

CancelOrderResponse

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "order": {
      "id": "99b1780c-d318-11e8-8f09-600308a3845a",
      "fillable_quantity": "10",
      "price": "5000.00",
      "quantity": "10",
      "side": "buy",
      "symbol": "BTC-USD.PPL.INV",
      "state": "active",
      "time_in_force": "GTC",
      "type": "limit",
      "updated_at": "2019-10-09T19:53:49Z",
      "valid_until": null
    }
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» order object true none The order requested to be cancelled.
»» id string false none The order ID.
»» fillable_quantity string false none The fillable quantity.
»» price string false none The order price, if set.
»» quantity string false none The requested quantity.
»» side string false none The order side.
»» symbol string false none The instrument symbol.
»» state string false none The order state. Will be active or pending if an order is cancellable.
»» time_in_force string false none The order time in force.
»» type string false none The order type.
»» updated_at string(date-time) false none Updated at timestamp.
»» valid_until string(date-time) false none Valid until timestamp for the order, if time_in_force = GTT.

Enumerated Values

Property Value
topic manage_orders
status ok
side buy
side sell
state pending
state active
state done
state cancelled
time_in_force GTC
time_in_force GTT
type limit
type market

CancelOpenOrdersAfterRequest

{
  "topic": "manage_orders",
  "type": "cancel_open_orders_after",
  "ref": 1,
  "payload": {
    "duration_in_msec": "60000"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
type string true none The type of request. Always cancel_open_orders_after.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» duration_in_msec string true none Elapsed time (in milliseconds) before open orders are cancelled.

Enumerated Values

Property Value
topic manage_orders
type cancel_open_orders_after

CancelOpenOrdersAfterResponse

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "requested_at": "2019-09-25T07:40:24.071724Z",
    "cancel_orders_at": "2019-09-25T07:41:24.071724Z",
    "duration_in_msec": "60000"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» requested_at string true none Time when the request to cancel open orders was received.
» cancel_orders_at string true none Time after which all open orders will be cancelled. Will be null if the process to cancel open orders is stopped.
» duration_in_msec integer true none Elapsed time (in milliseconds) before open orders are cancelled. Same value as sent in the request.

Enumerated Values

Property Value
topic manage_orders
status ok

ListOpenOrdersRequest

{
  "topic": "manage_orders",
  "type": "list_open_orders",
  "ref": 1,
  "payload": {
    "symbol": "BTC-USD.PPL.INV"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
type string true none The type of request. Always list_open_orders.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» symbol string true none The instrument symbol.

Enumerated Values

Property Value
topic manage_orders
type list_open_orders

ListOpenOrdersResponse

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "orders": [
      {
        "id": "99b1780c-d318-11e8-8f09-600308a3845a",
        "fillable_quantity": "10",
        "price": "5000.00",
        "quantity": "10",
        "side": "buy",
        "symbol": "BTC-USD.PPL.INV",
        "state": "active",
        "time_in_force": "GTT",
        "type": "limit",
        "updated_at": "2019-10-09T19:53:49Z",
        "valid_until": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» orders [object] true none List of open orders.
»» id string false none The order ID.
»» fillable_quantity string false none The fillable quantity.
»» price string false none The order price, if set.
»» quantity string false none The requested quantity.
»» side string false none The order side.
»» symbol string false none The instrument symbol.
»» state string false none The order state. Will be active or pending if an order is cancellable.
»» time_in_force string false none The order time in force.
»» type string false none The order type.
»» updated_at string(date-time) false none Updated at timestamp.
»» valid_until string(date-time) false none Valid until timestamp for the order, if time_in_force = GTT.

Enumerated Values

Property Value
topic manage_orders
status ok
side buy
side sell
state pending
state active
state done
state cancelled
time_in_force GTC
time_in_force GTT
type limit
type market

ListRecentFillsRequest

{
  "topic": "manage_orders",
  "type": "list_recent_fills",
  "ref": 1,
  "payload": {
    "count": "100",
    "symbol": "BTC-USD.PPL.INV"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
type string true none The type of request. Always list_recent_fills.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» count string false none Max number of fills to return.
» symbol string false none Optional instrument symbol.

Enumerated Values

Property Value
topic manage_orders
type list_recent_fills

ListRecentFillsResponse

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "fills": [
      {
        "id": "c97ac164-e8cf-410f-9ccf-53a590b0143f",
        "type": "maker",
        "quantity": "20",
        "price": "5002.50",
        "order_id": "7e5808d4-d4e8-4171-8ecb-30b26096c371",
        "symbol": "BTC-USD.PPL.INV",
        "fee_amount": "-0.00000123",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_orders.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» fills [object] true none List of requested fills.
»» id string false none The id of the fill.
»» type string false none Whether the order was filled as a maker or taker. (Same as whether the order was a maker or taker).
»» quantity string false none The filled quantity.
»» price string false none The price at which the quantity was filled. For a maker, the fill price is the same as the order price. For a taker, the fill price is the weighted average price of all orders with which the order was matched.
»» order_id string false none The id of the order that was filled.
»» symbol string false none The instrument symbol.
»» fee_amount string false none Taker fee or maker rebate (negative fee represents a maker rebate).
»» timestamp string(date-time) false none The time at which the order was filled.

Enumerated Values

Property Value
topic manage_orders
status ok
type maker
type taker

ManagePositionsRequest

{
  "topic": "manage_positions",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_positions
type join_channel

ManagePositionsResponse

{
  "topic": "manage_positions",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_positions
status ok

ListPositionsRequest

{
  "topic": "manage_positions",
  "type": "list_positions",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
type string true none The type of request. Always list_positions.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_positions
type list_positions

ListPositionsResponse

{
  "topic": "manage_positions",
  "status": "ok",
  "ref": 1,
  "payload": {
    "positions": [
      {
        "symbol": "BTC-USD.PPL.INV",
        "size": "10.00",
        "entry_value": "0.00200000",
        "entry_price": "5000.00",
        "leverage": "10",
        "margin_type": "isolated",
        "margin": "0.00020000",
        "liquidation_price": "4000.00"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» positions [object] true none List of all positions across all instruments.
»» symbol string false none The instrument symbol.
»» size string false none The position's size.
»» entry_value string false none The position's value based on the average entry price.
»» entry_price string false none The position's average entry price.
»» leverage string false none The position's leverage, if margin_type = isolated. Will be null if margin_type = cross.
»» margin_type string false none The position's margin type.
»» margin string false none The position's margin.
»» liquidation_price string false none The position's liquidation price.

Enumerated Values

Property Value
topic manage_positions
status ok
margin_type isolated
margin_type cross

UpdatePositionLeverageRequest

{
  "topic": "manage_position",
  "type": "update_position_leverage",
  "ref": 1,
  "payload": {
    "symbol": "BTC-USD.PPL.INV",
    "margin_type": "cross",
    "leverage": null
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
type string true none The type of request. Always update_position_leverage.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» symbol string true none The instrument symbol.
» margin_type string true none Margin type for the position (cross or isolated).
» leverage string false none Requested leverage (null if margin_type is 'cross')

Enumerated Values

Property Value
topic manage_position
type update_position_leverage
margin_type isolated
margin_type cross

UpdatePositionLeverageResponse

{
  "topic": "manage_positions",
  "status": "ok",
  "ref": 1,
  "payload": {
    "position": {
      "symbol": "BTC-USD.PPL.INV",
      "size": "10",
      "leverage": null,
      "margin_type": "cross",
      "liquidation_price": "4000.00"
    }
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» position object true none none
»» symbol string false none The instrument symbol.
»» size string false none The position size.
»» leverage string false none The position leverage, if margin_type = isolated. Will be null if margin_type = cross.
»» margin_type string false none The position margin type.
»» liquidation_price string false none The position liquidation price.

Enumerated Values

Property Value
topic manage_positions
status ok
margin_type isolated
margin_type cross

ListRecentLiquidationsRequest

{
  "topic": "manage_positions",
  "type": "list_recent_liquidations",
  "ref": 1,
  "payload": {
    "count": "10"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
type string true none The type of request. Always list_recent_liquidations.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» count string false none Max number of liquidations to return.

Enumerated Values

Property Value
topic manage_positions
type list_recent_liquidations

ListRecentLiquidationsResponse

{
  "topic": "manage_orders",
  "status": "ok",
  "ref": 1,
  "payload": {
    "liquidations": [
      {
        "id": "5d838268-b4b6-451d-915e-5e81ff57bcff",
        "symbol": "BTC-USD.PPL.INV",
        "liquidated_position_type": "long",
        "liquidated_position_margin_type": "isolated",
        "liquidated_position_leverage": "50.0",
        "liquidated_position_quantity": "2000",
        "liquidated_position_liquidation_price": "6127.08",
        "mark_price": "6126.99",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» liquidations [object] true none List of requested liquidations.
»» id string false none The id of the liquidation.
»» symbol string false none The instrument symbol.
»» liquidated_position_type string false none Whether the liquidated position was long or short
»» liquidated_position_margin_type string false none The margin type of the liquidated position (isolated or cross).
»» liquidated_position_leverage string false none The leverage of the liquidated position.
»» liquidated_position_quantity string false none The number of contracts of the liquidated position.
»» liquidated_position_liquidation_price string false none The liquidation price of the liquidated position.
»» mark_price string false none The mark price at the time of liquidation.
»» timestamp string(date-time) false none The time of the liquidation.

Enumerated Values

Property Value
topic manage_orders
status ok
liquidated_position_type long
liquidated_position_type short
liquidated_position_margin_type isolated
liquidated_position_margin_type cross

ListRecentTerminationsRequest

{
  "topic": "manage_positions",
  "type": "list_recent_terminations",
  "ref": 1,
  "payload": {
    "count": "10"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
type string true none The type of request. Always list_recent_terminations.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» count string false none Max number of terminations to return.

Enumerated Values

Property Value
topic manage_positions
type list_recent_terminations

ListRecentTerminationsResponse

{
  "topic": "manage_positions",
  "status": "ok",
  "ref": 1,
  "payload": {
    "terminations": [
      {
        "id": "5b574d7a-5e06-4c97-a128-985e3508bcb7",
        "symbol": "BTC-USD.PPL.INV",
        "terminated_quantity": "1500",
        "terminated_position_entry_price": "6250.00",
        "terminated_position_quantity": "2000",
        "terminated_position_type": "short",
        "terminated_position_margin_type": "isolated",
        "terminated_position_leverage": "10.0",
        "termination_price": "6107.25",
        "realized_profit": "0.01000000",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_positions.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» terminations [object] true none List of requested terminations.
»» id string false none The id of the termination.
»» symbol string false none The instrument symbol.
»» terminated_quantity string false none Number of contracts terminated from the position. Always less than or equal to terminated_position_quantity.
»» terminated_position_entry_price string false none The entry price of the terminated position.
»» terminated_position_quantity string false none Total number of contracts in the terminated position.
»» terminated_position_type string false none Whether the terminated position was long or short.
»» terminated_position_margin_type string false none The margin type of the terminated position (isolated or cross).
»» terminated_position_leverage string false none The leverage of the terminated position.
»» termination_price string false none The price at which the position was terminated.
»» realized_profit string false none The profit realized from terminating the position at the termination price.
»» timestamp string(date-time) false none The time of the termination.

Enumerated Values

Property Value
topic manage_positions
status ok
terminated_position_type long
terminated_position_type short
terminated_position_margin_type isolated
terminated_position_margin_type cross

ManageAccountRequest

{
  "topic": "manage_account",
  "type": "join_channel",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
type string true none The type of request. Always join_channel.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_account
type join_channel

ManageAccountResponse

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_account
status ok

GetAccountInfoRequest

{
  "topic": "manage_account",
  "type": "get_account_info",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
type string true none The type of request. Always get_account_info.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_account
type get_account_info

GetAccountInfoResponse

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "account_info": {
      "user_id": "8283851c-d875-40c4-b05b-4299be141ff7",
      "email": "trader@example.com"
    }
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object false none none
» account_info object true none The account info.
»» user_id string false none The id of the API user.
»» email string false none The email of the API user.

Enumerated Values

Property Value
topic manage_account
status ok

GetDepositAddressRequest

{
  "topic": "manage_account",
  "type": "get_deposit_address",
  "ref": 1,
  "payload": {
    "currency_symbol": "BTC"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
type string true none The type of request. Always get_deposit_address.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» currency_symbol string true none none

Enumerated Values

Property Value
topic manage_account
type get_deposit_address
currency_symbol BTC
currency_symbol USDT

GetDepositAddressResponse

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "deposit_address": {
      "currency_symbol": "BTC",
      "address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"
    }
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» deposit_address object true none The current deposit address.
»» currency_symbol string true none none
»» address string true none none

Enumerated Values

Property Value
topic manage_account
status ok
currency_symbol BTC
currency_symbol USDT

WithdrawFundsRequest

{
  "topic": "manage_account",
  "type": "withdraw_funds",
  "ref": 1,
  "payload": {
    "currency_symbol": "BTC",
    "amount": "1.5",
    "destination_address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN9"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
type string true none The type of request. Always withdraw_funds.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» currency_symbol string true none Collateral currency symbol of the wallet.
» amount string true none The amount to withdraw, denominated in the collateral currency.
» destination_address string true none The crypto address to send funds to (e.g. the Bitcoin address if BTC).

Enumerated Values

Property Value
topic manage_account
type withdraw_funds
currency_symbol BTC
currency_symbol USDT

WithdrawFundsResponse

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "withdrawal": {
      "id": "79a267f4-d333-11e8-a6eb-600308a3845a",
      "currency_symbol": "BTC",
      "destination_address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
      "amount": "1.5",
      "state": "pending"
    }
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» withdrawal object true none The withdrawal request.
»» id string true none The ID for this withdrawal request.
»» currency_symbol string true none Collateral currency symbol of the wallet.
»» destination_address string true none The crypto address to send funds to (e.g. the Bitcoin address if BTC).
»» amount string false none The amount to withdraw, denominated in the collateral currency.
»» state string false none The withdrawal state. Always starts as pending.

Enumerated Values

Property Value
topic manage_account
status ok
currency_symbol BTC
currency_symbol USDT
state pending

ListWalletsRequest

{
  "topic": "manage_account",
  "type": "list_wallets",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
type string true none The type of request. Always list_wallets.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_account
type list_wallets

ListWalletsResponse

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "wallets": [
      {
        "currency_symbol": "BTC",
        "cash_balance": "1.5",
        "available_cash_balance": "1.0",
        "trading_balance": "3.0",
        "earmarked_for_withdrawal": "0.5",
        "pending_withdrawal": "0.3"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» wallets [object] true none All wallets across all collateral currencies.
»» currency_symbol string false none Collateral currency symbol of the wallet.
»» cash_balance string false none Cash balance of the wallet.
»» available_cash_balance string false none Cash balance of the wallet minus amount earmarked for withdrawal (pending, processing, and locked).
»» trading_balance string false none Total funds available for trading.
»» earmarked_for_withdrawal string false none Total funds earmarked for withdrawal, which included pending, processing and locked withdrawals. Withdrawals that are pending may be cancelled, while those in processing or locked state cannot.
»» pending_withdrawal string false none Total funds pending withdrawal. Withdrawals that are pending may be cancelled.

Enumerated Values

Property Value
topic manage_account
status ok
currency_symbol BTC
currency_symbol USDT

TransferFundsRequest

{
  "topic": "manage_account",
  "type": "transfer_funds",
  "ref": 1,
  "payload": {
    "currency_symbol": "BTC",
    "amount": "1.50000000",
    "transfer_type": "cash_to_trading"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
type string true none The type of request. Always transfer_funds.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» currency_symbol string true none Symbol of currency.
» amount string true none none
» transfer_type string true none Either cash_to_trading or trading_to_cash.

Enumerated Values

Property Value
topic manage_account
type transfer_funds
currency_symbol BTC
currency_symbol USDT
transfer_type cash_to_trading
transfer_type trading_to_cash

TransferFundsResponse

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "transfer": {
      "id": "79a267f4-d333-11e8-a6eb-600308a3845a",
      "currency_symbol": "BTC",
      "amount": "1.50000000",
      "transfer_type": "cash_to_trading",
      "timestamp": "2019-10-09T19:53:49Z"
    }
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» transfer object true none The transfer of funds between cash and trading wallets.
»» id string true none none
»» currency_symbol string true none none
»» amount string true none none
»» transfer_type string false none none
»» timestamp string(date-time) true none none

Enumerated Values

Property Value
topic manage_account
status ok
currency_symbol BTC
transfer_type cash_to_trading
transfer_type trading_to_cash

ListTransfersRequest

{
  "topic": "manage_account",
  "type": "list_transfers",
  "ref": 1,
  "payload": {
    "currency_symbol": "BTC"
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
type string true none The type of request. Always list_transfers.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object false none none
» currency_symbol string true none Symbol of currency.

Enumerated Values

Property Value
topic manage_account
type list_transfers
currency_symbol BTC
currency_symbol USDT

ListTransfersResponse

{
  "topic": "manage_account",
  "status": "ok",
  "ref": 1,
  "payload": {
    "transfers": [
      {
        "id": "99b1780c-d318-11e8-8f09-600308a3845a",
        "currency_symbol": "BTC",
        "amount": "0.7",
        "type": "trading_balance_deposit",
        "timestamp": "2019-10-09T19:53:49Z"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_account.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

continued

Name Type Required Restrictions Description
payload object true none none
» transfers [object] true none List of transfers.
»» id string true none The id of the transfer.
»» currency_symbol string true none The currency symbol.
»» amount string true none The amount transferred, denominated in the collateral currency.
»» type string true none The transfer type.
»» timestamp string(date-time) true none The time at which the transfer occurred.

Enumerated Values

Property Value
topic manage_account
status ok
currency_symbol BTC
type trading_balance_deposit
type withdrawal

HeartbeatRequest

{
  "topic": "manage_connection",
  "type": "heartbeat",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_connection.
type string true none The type of request. Always heartbeat.
ref any false none A unique client-generated reference value for this request, typically a monotonically increasing integer or UUID. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_connection
type heartbeat

HeartbeatResponse

{
  "topic": "manage_connection",
  "status": "ok",
  "ref": 1
}

Properties

Name Type Required Restrictions Description
topic string true none The channel topic. Always manage_connection.
status string true none The success response status. Always ok.
ref any false none Matches the client-generated reference value for a request. Used for request-response semantics.

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous integer false none none

Enumerated Values

Property Value
topic manage_connection
status ok