Public Socket Messages
Data such as orderbook, ticker and last transactions are not sent directly after connection made.
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
| Field | Type | Description |
|---|---|---|
tradeResultId | Long | Unique identifier of the trade execution |
pairSymbol | String | Trading pair symbol |
amount | Decimal | Executed trade amount (base asset quantity) |
price | Decimal | Execution price |
createdAt | String | Trade timestamp (UTC, ISO 8601 format) |
feeType | Int32 | Fee type (1 = Taker) |
side | Int32 | Taker 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
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.
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
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
| Field | Type | Description |
|---|---|---|
pairSymbol | String | Trading pair symbol |
timestamp | Int64 | Unix timestamp in milliseconds |
bid | Decimal | Best bid price |
bidAmount | Decimal | Quantity available at best bid |
ask | Decimal | Best ask price |
askAmount | Decimal | Quantity available at best ask |
last | Decimal | Last traded price |
volume | Decimal | 24-hour traded base asset volume |
open | Decimal | 24-hour opening price |
high | Decimal | Highest price in the last 24 hours |
low | Decimal | Lowest price in the last 24 hours |
average | Decimal | 24-hour average price |
daily | Decimal | 24-hour price change (absolute) |
dailyPercent | Decimal | 24-hour price change (percentage) |
weightedVolume | Decimal | 24-hour quote volume (price × amount aggregate) |
Behavior Notes
TickerPairsends updates only for the specified pair.TickerAllsends 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
OrderBookSnapshotmessage 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:
- Inserted — A new price level has been added.
- Updated — The quantity at this price level has changed.
- 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
OrderBooksnapshot 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:
- Subscribe to
OrderBook - Wait for snapshot (max 750ms)
- Subscribe to
OrderBookDiff - First Order Book Difference data will be received in 750ms
- Order Book Difference data will be received every 750ms
Unsubscribe Request:
109|{"pairSymbol":"BTCTRY"}
Unsubscribe Response:
209