API Reference

Subscribe to Price Channel

Account Groups

To retrieve the list of account groups associated with the user. Used as parameter for order request.

Request

FieldReq'dTypeDescription
messageTypeYStringaccountGroups

Request Example:

{
    "messageType": "accountGroups"
}

Response

FieldReq'dTypeDescription
timestampYLongUnix time in milliseconds
messageTypeYStringaccountGroups
messageYStringConfirmation message
codeYStringError code
accountGroupsNStringAccount groups list
uuidYStringAccount group uuid
nameYStringAccount group name

Response Example:

{
  "timestamp": 1658832215293,
  "messageType": "accountGroups",
  "message": "Account Groups retrieved",
  "code": "",
  "accountGroups": [
    {
      "uuid":"testAccountGroupUuid",
      "name":"testAccountGroupName"
    },
    {
      "uuid":"testAccountGroupUuid2",
      "name":"testAccountGroupName2"
    },
    {
      "uuid":"testAccountGroupUuid3",
      "name":"testAccountGroupName3"
    }
  ]
}

Subscribe

Subscribe to a price stream of bids and asks, in the requested coin-pair, with respect to the requested settlement quantity, which may be in base or terms as specified in currency.

Request

FieldReq'dTypeDescription
messageTypeYStringsubscribe
instrumentYStringCurrency-pair but with "." as a separator of base currency and quote currency.
tagNStringFor future use
quantityYDoubleQuantity (in 'Currency') up to 20BTC or 250ETH
currencyYStringCurrency the price stream is quoted in
accountGrpUuidNStringAccount group ref to use

Request Example:

{
    "messageType": "subscribe",
    "instrument": "BTC.USD",
    "tag": "For future use",
    "quantity": 0.0111,
    "currency": "BTC",
    "accountGrpUuid": ""
}

Response

Indicates if the subscription is successful and if not, message field will indicate reason.

FieldReq'dTypeDescription
timestampYLongUnix time in milliseconds
messageTypeYStringsubscribe
successYboolIndicates if subscribeRequest is successful true
messageYStringConfirmation is successful subscribed
subscriptionIdYStringStream subscription ID
instrumentYStringCurrency-pair but with "." as a separator of base currency and quote currency.
quantityYDoubleQuantity of the currency to be delivered
codeNStringError code

Response Example:

{
    "timestamp": 84546108725635,
    "messageType": "subscribe",
    "success": true,
    "message": "Subscribed",
    "subscriptionId": "d184314f-73bf-4dea-931e-c3e5c4b5bfce",
    "instrument": "BTC.USD",
    "quantity": "0.002000",
    "code": ""
}

Unsubscribe

Unsubscribe from a from a previously requested price stream by sending the subscriptionId of the desired quote/price stream to terminate.

Request

FieldReq'dTypeDescription
messageTypeYStringunsubscribe
subscriptionIdYStringSubscription ID of the priceStream to be unsubscribed

Request Example:

{
    "messageType": "unsubscribe",
    "subscriptionId": "<SUBSCRIPTION_ID>"
}

Response

Indicates if the unsubscription is successful and if not, message field will indicate reason.

FieldReq'dTypeDescription
timestampYLongUnix time in milliseconds
messageTypeYStringunsubscribe
successYboolIndicates if unsubscribe is successful true or false
messageYStringConformation description
instrumentYStringCurrency-pair but with "." as a separator of base currency and quote currency.
quantityYDoubleRequested Quantity

Response Example:

{
    "timestamp": 137169153651952,
    "messageType": "unsubscribe",
    "success": true,
    "message": "Subscription with the ID <SUBSCRIPTION_ID> was cancelled!",
    "instrument": "BTC.USD",
    "quantity": 0.011100
}

Price Stream

Response

The response contains a two way price (bid and offer) with respective quantities available for trading (partial fills are not available). The full order book is not sent at every tick rather, an updated quote for the subscribed quantity is sent. New prices will automatically replace the previous prices.

In the unlikely event the connection is lost users can download their transactions for reconciliation.

Heartbeats are not supported.

FieldReq'dTypeDescription
timestampYLongUnix time in milliseconds
messageTypeYStringpriceStream
instrumentYStringCurrency-pair but with "." as a separator of base currency and quote currency.
quoteIdYStringQuote ID
tagNStringTesting purposes
offerYOffer
↳ priceYDoubleQuote Offer Price
↳ quantityYDoubleQuote Offer Quantity
bidYBid
↳ priceYDoubleQuote Bid Price
↳ quantityYDoubleQuote Bid Quantity
{
    "timestamp": 408740417388844,
    "messageType": "priceStream",
    "instrument": "BTC.USD",
    "quoteId": "dHs2UwjxfwqwOIXKfGHq1NHtDWEA6UTTvc4aTQD8yHQ+9wXks1bkB9Ey6LbqeAuDsg==",
    "tag": "",
    "offer": {
        "price": 38956.140000,
        "quantity": 0.0256
    },
    "bid": {
        "price": 38868.880000,
        "quantity": 0.0257
    }
}