Skip to main content

Public Socket Messages

Data such as orderbook, ticker and last transactions are not sent directly after connection made.

warning

Once subscribed to a message type, the server sends requested data continuously to the client, unless the unsubscribe message is sent.

Trade Subscription

Request:

Subscribes to real-time public trade executions for a specific trading pair.

100|{"pairSymbol":"BTCTRY"}

Subscription Response:

If the subscription is successful, the server returns:

200

Message (Trade Event):

A trade message is sent each time a trade is executed for the subscribed pair.

{
"tradeResultId": 126263842116495580,
"pairSymbol": "BTCTRY",
"amount": 0.0349164000,
"price": 1947490.0000000000,
"createdAt": "2024-09-10T08:31:56.133Z",
"feeType": 1,
"side": 0
}

Trade Event Field Descriptions

FieldTypeDescription
tradeResultIdLongUnique identifier of the trade execution
pairSymbolStringTrading pair symbol
amountDecimalExecuted trade amount (base asset quantity)
priceDecimalExecution price
createdAtStringTrade timestamp (UTC, ISO 8601 format)
feeTypeInt32Fee type (1 = Taker)
sideInt32Taker side (0 = Buy, 1 = Sell)

Behavior Notes

  • A trade message is sent only when a new trade occurs.
  • There is no periodic broadcast interval.
  • Messages are delivered in real time as trades are executed.
  • Each trade event is independent and does not rely on previous messages.

Unsubscribe Request:

101|{"pairSymbol":"BTCTRY"}

Unsubscribe Response:

201

Ticker All Subscription

warning

This subscription broadcasts ticker data for all trading pairs and may generate a high volume of traffic. For better performance and bandwidth efficiency, use Ticker Pair Subscription instead.

info

Ticker All & Ticker Pair subscription provides real-time data every 750ms or less. It’s a statistical service that requires calculation. For realtime trade data, use Trade subscription.

Request:

Subscribes to latest ticker data for all trading pairs. Updates every 750ms or less.

102

Subscription Response:

If the subscription is successful, the server returns:

202

Message:

The server sends an array containing ticker data for all pairs.

304|[
{
"pairSymbol": "BTCTRY",
"timestamp": 1708972146203,
"bid": 55000.0,
"bidAmount": 0.036,
"ask": 58000.0,
"askAmount": 0.0475951382986192,
"last": 58000.0,
"volume": 14.8685646993653757,
"open": 58700.0,
"high": 60400.0,
"low": 41234.0,
"average": 56768.78795137,
"daily": -700.0,
"dailyPercent": -1.1925042589437819420783645700,
"weightedVolume": 844070.39655939394757000
}
]

Field Descriptions

See: Ticker Field Descriptions

Behavior Notes

  • The server broadcasts updated ticker data when market values change.
  • The message contains all available trading pairs.
  • There is no guarantee of a fixed interval; messages are sent when updates occur.

Unsubscribe Request:

103

Unsubscribe Response:

203

Ticker Pair Subscription

info

Ticker All & Ticker Pair subscription provides real-time data every 750ms or less. It’s a statistical service that requires calculation. For realtime trade data, use Trade subscription.

Request:

Subscribes to latest ticker data for a single trading pair. Updates every 750ms or less.

104|{"pairSymbol":"BTCTRY"}

Subscription Response:

When the subscription is successful, the server returns a 204 message type.

204

Message:

305|{
"pairSymbol": "BTCTRY",
"timestamp": 1708971583515,
"bid": 55000.0,
"bidAmount": 0.036,
"ask": 58000.0,
"askAmount": 0.0475951382986192,
"last": 58000.0,
"volume": 14.8685646993653757,
"open": 58700.0,
"high": 60400.0,
"low": 41234.0,
"average": 56768.78795137,
"daily": -700.0,
"dailyPercent": -1.1925042589437819420783645700,
"weightedVolume": 844070.39655939394757000
}

Ticker Field Descriptions

FieldTypeDescription
pairSymbolStringTrading pair symbol
timestampInt64Unix timestamp in milliseconds
bidDecimalBest bid price
bidAmountDecimalQuantity available at best bid
askDecimalBest ask price
askAmountDecimalQuantity available at best ask
lastDecimalLast traded price
volumeDecimal24-hour traded base asset volume
openDecimal24-hour opening price
highDecimalHighest price in the last 24 hours
lowDecimalLowest price in the last 24 hours
averageDecimal24-hour average price
dailyDecimal24-hour price change (absolute)
dailyPercentDecimal24-hour price change (percentage)
weightedVolumeDecimal24-hour quote volume (price × amount aggregate)

Behavior Notes

  • TickerPair sends updates only for the specified pair.
  • TickerAll sends an array including all pairs.
  • Messages are event-driven and sent when ticker values change.
  • Each message contains the latest calculated 24-hour statistics.

Unsubscribe Request:

105|{"pairSymbol":"BTCTRY"}

Unsubscribe Response:

205

OrderBook Snapshot Subscription

Important Clarification

The server sends snapshot of order book data in 750ms once.

Then every 750ms:

  • The system checks for changes.
  • A OrderBookSnapshot message is sent only if a change is detected.

Request:

Client subscribes to the full order book of a specific pair.

106|{"pairSymbol":"BTCTRY"}

Subscription Response:

When the subscription is successful, the server returns:

206

Message:

306|{
"asks": [
{
"price": 58000.0,
"amount": 0.0475951382986192
},
{
"price": 58500.0,
"amount": 0.05
},
{
"price": 59000.0,
"amount": 0.05
},
{
"price": 60000.0,
"amount": 0.3637750645162508
},
{
"price": 60400.0,
"amount": 3.6359745807544676
},
],
"bids": [
{
"price": 55000.0,
"amount": 0.036
},
{
"price": 54500.0,
"amount": 0.05
},
{
"price": 54000.0,
"amount": 0.05
},
{
"price": 2.0,
"amount": 120.0
}
],
"pairSymbol": "BTCTRY",
"changeSet": 200
}

Unsubscribe Request:

107|{"pairSymbol":"BTCTRY"}

Unsubscribe Response:

207

Orderbook Difference Subscription

Important Clarification

The server does not necessarily send messages every 750 ms.

Instead:

  • The system checks for changes approximately every 750 ms.
  • A OrderBookDiff message is sent only if a change is detected.
  • The first response returns the full order book; subsequent responses return only the diff.

No message is sent if the book remains unchanged.

Request:

Subscribe to receive only incremental changes of a specific pair.

108|{"pairSymbol":"BTCTRY"}

Subscription Response:

When the subscription is successful, the server returns a 208 message type.

208

Message (Incremental Update):

307|{
"changeSet": 203,
"pair": "BTCTRY",
"askOrders": [],
"bidOrders": [
{
"process": 2, //Updated
"price": "41234",
"amount": "1.88452781578"
},
{
"process": 1, //Inserted
"price": "41235",
"amount": "3.959801325468"
},
{
"process": 3, //Deleted
"price": "41238",
"amount": "2"
}
]
}

The process field indicates the status of the order at the given price:

  1. Inserted — A new price level has been added.
  2. Updated — The quantity at this price level has changed.
  3. Deleted — The price level no longer exists in the order book.

The changeSet field represents a change counter for the order book of a specific pair.

  • The initial value is 200.
  • It increments only when at least one price level change occurs.
  • If no changes occur, the value remains the same.
  • The next value resets to initial value when reaches 2147482647.
  • If maintanence or update occurs in API; value resets to initial value.

⚠ Critical Usage Notes

OrderBookDiff does not include the full book state.

  • A client must already have a valid OrderBook snapshot to correctly apply diffs.
  • The server does not automatically send a snapshot when subscribing to diff.
  • If the client subscribes only to OrderBookDiff, it may receive diffs without having initial state data.

Recommended flow for reliable state synchronization:

  1. Subscribe to OrderBook
  2. Wait for snapshot (max 750ms)
  3. Subscribe to OrderBookDiff
  4. First Order Book Difference data will be received in 750ms
  5. Order Book Difference data will be received every 750ms

Unsubscribe Request:

109|{"pairSymbol":"BTCTRY"}

Unsubscribe Response:

209