Private Socket Messages
Private socket messages are delivered only to authenticated users and contain account-specific events.
UserTrade
Sent when one of the user's order is matched (fully or partially).
Message Type
400
Message
400|{
"id": 1003163838839889300,
"orderId": 433596,
"externalOrderId": "hft-order-id",
"price": 47750,
"timestamp": 1710535431775,
"accountId": "1db31fd2df9642d5b2ecbe09129697d9",
"side": "Sell",
"feeType": "Taker",
"pairSymbol": "ETHTRY",
"amount": -0.001,
"feePercentage": 0.000666667,
"taxPercentage": 0.2,
"orderPrice": 47750,
"numeratorAmount": -0.001,
"denominatorAmount": 47.75,
"feeAmount": -0.03183334925,
"taxAmount": -0.00636666985
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
id | Int64 | Unique trade identifier |
orderId | Int64 | Internal order identifier |
externalOrderId | String | Client-provided order identifier |
price | Decimal | Execution price |
timestamp | Int64 | Execution timestamp (Unix ms) |
accountId | String | Account identifier |
side | String | Trade side (Buy, Sell) |
feeType | String | Liquidity role (Maker, Taker) |
pairSymbol | String | Trading pair |
amount | Decimal | Executed base asset quantity |
feePercentage | Decimal | Applied fee rate |
taxPercentage | Decimal | Applied tax rate |
orderPrice | Decimal | Original order price |
numeratorAmount | Decimal | Base asset amount |
denominatorAmount | Decimal | Quote asset amount |
feeAmount | Decimal | Calculated fee amount |
taxAmount | Decimal | Calculated tax amount |
Enum Values
-
Side
- 0 : Buy
- 1 : Sell
-
FeeType
- 0 : Maker
- 1 : Taker
Behavior Notes
- A UserTrade message is sent for each execution event.
- Partial fills may generate multiple UserTrade messages.
- This message represents the execution detail, not the full order state.
Order Updated
Sent when an order state changes due to matching or cancellation.
Message Type
402
Message
402|{
"id": 564177,
"accountId": "0009f8b0832c429dac75a7f882ee58f8",
"pairSymbol": "ETHTRY",
"method": "Limit",
"type": "Buy",
"status": "Partial",
"createdAt": "2024-07-11T07:36:40.6483668",
"createdBy": "[email protected]",
"externalOrderId": "hft-order-id",
"feePercentage": 0.0001666666666667,
"taxPercentage": 0.0000000000000000,
"price": 1.5000000000000000,
"initialAmount": 0.5000000000000000,
"currentAmount": 0.3000000000000000,
"matchedAmount": 0.2000000000000000,
"initialTotal": 0.7501250000000000,
"currentTotal": 0.4500750000000000,
"matchedTotal": 0.3000500000000000
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
id | Int64 | Order identifier |
accountId | String | Account identifier |
pairSymbol | String | Trading pair |
method | String | Order method (Limit, Market) |
type | String | Order side (Buy, Sell) |
status | String | Current order status |
createdAt | String | Order creation timestamp (ISO 8601) |
createdBy | String | Creator identifier |
externalOrderId | String | Client-provided order identifier |
feePercentage | Decimal | Fee rate |
taxPercentage | Decimal | Tax rate |
price | Decimal | Order price |
initialAmount | Decimal | Original order quantity |
currentAmount | Decimal | Remaining quantity |
matchedAmount | Decimal | Executed quantity |
initialTotal | Decimal | Original total value |
currentTotal | Decimal | Remaining total value |
matchedTotal | Decimal | Executed total value |
Order Status Values
- Untouched
- Partial
- Closed
- Canceled
For trade-related updates, the status will be either:
- Partial
- Closed
Create Order Request
Creates a new order on behalf of the authenticated user.
Message Type
501
Request
501|{
"quantity": "1.00",
"price": "42350.00",
"orderMethod": "Market", //Limit, Market
"orderType": "Buy", //Buy, Sell
"pairSymbol": "BTCTRY",
"externalOrderId": "hft-order-id",
"userEmail": "[email protected]"
}
Request Field Descriptions
| Field | Type | Description |
|---|---|---|
quantity | String (Decimal) | Order quantity |
price | String (Decimal) | Order price |
orderMethod | String | Limit or Market |
orderType | String | Buy or Sell |
pairSymbol | String | Trading pair symbol |
externalOrderId | String | Client-provided unique order identifier |
userEmail | String | User identifier (must match authenticated account) |
Create Order Response
Message Type
601
Response
601|{
"statusCode": 201,
"content": {
"id": 433598,
"accountId": "0009f8b0832c429dac75a7f882ee58f8",
"pairSymbol": "ETHTRY",
"feePercentage": 0.000083333,
"taxPercentage": 0.2,
"initialAmount": 0.001,
"currentAmount": 0.001,
"matchedAmount": 0,
"price": 10000,
"initialTotal": 10.000999996,
"currentTotal": 10.000999996,
"matchedTotal": 0,
"method": "Limit",
"type": "Buy",
"externalOrderId": "hft-order-id"
}
}
Success Field Descriptions
| Field | Type | Description |
|---|---|---|
statusCode | Int32 | HTTP-style status code (201 = Created) |
content.id | Int64 | Internal order identifier |
content.accountId | String | Account identifier |
content.pairSymbol | String | Trading pair |
content.feePercentage | Decimal | Applied fee rate |
content.taxPercentage | Decimal | Applied tax rate |
content.initialAmount | Decimal | Original order quantity |
content.currentAmount | Decimal | Remaining quantity |
content.matchedAmount | Decimal | Executed quantity |
content.price | Decimal | Order price |
content.initialTotal | Decimal | Original order total |
content.currentTotal | Decimal | Remaining order total |
content.matchedTotal | Decimal | Executed total value |
content.method | String | Limit or Market |
content.type | String | Buy or Sell |
content.externalOrderId | String | Client-provided order identifier |
Order Creation Failed
If the request fails, a 601 message is returned with an appropriate statusCode.
- Invalid Request
- Too Many Request
601|{
"statusCode": 400,
"content": {
"type": "501",
"title": "NotNullValidator",
"status": 400,
"detail": "PairSymbol is required",
"instance": "CreateOrderRequest"
},
"request": {
"pairSymbol": null,
"quantity": "0.05",
"price": "31733",
"externalOrderId": "hft-order-id",
"orderMethod": "Limit",
"orderType": "Buy",
"userEmail": "[email protected]"
}
}
601|{
"statusCode": 429,
"content": {
"type": "501",
"title": "TooManyRequests",
"status": 429,
"detail": "Quota exceeded. Maximum allowed: 30 per 1s.",
"instance": "Too_Many_501_Requests"
},
"request": {
"pairSymbol": "BTCTRY",
"quantity": "0.05",
"price": "31733",
"externalOrderId": "hft-order-id",
"orderMethod": "Limit",
"orderType": "Buy",
"userEmail": "[email protected]"
}
}
Behavior Notes
statusCodefollows HTTP semantics:201→ Order created400→ Validation error429→ Rate limit exceeded
- For
Marketorders, thepricefield may be ignored by the matching engine. - If the order is immediately matched, subsequent
UserTrade (400)andOrderUpdated (402)messages will follow. externalOrderIduser friendly identifier can be used to ensure idempotency on the client side.
Cancel Order Request
Cancels an existing open order.
Order cancellation is not guaranteed. If a matching order is already pending or being processed, the order may be executed (partially or fully) before the cancellation takes effect.
Message Type
502
Request
502|{"orderId": 433312}
Cancel Order Response
Message Type
602
Order Cancel Request Accepted (Queued for Processing)
If the cancellation request is successfully accepted for processing:
602|{
"statusCode": 202,
"content": {
"orderId": 433598,
"externalOrderId": "hft-order-id"
}
}
Note:
202 Accepted means the request has been received and queued.
The actual cancellation result will be delivered asynchronously via message type 401.
Already Cancelled
If the order is already cancelled:
602|{
"statusCode": 204,
"content": {
"orderId": 433599,
"externalOrderId": "hft-order-id"
}
}
Order Cancel Request Failed
If the cancellation request fails, a 602 message is returned with an appropriate statusCode.
- Invalid Request
- Too Many Request
- Invalid Order Status
- Market Order Not Cancellable
602|{
"statusCode": 404,
"content": {
"type": "502",
"title": "OrderNotFound",
"status": 404,
"detail": "Order is not found.",
"instance": "CancelOrderRequest"
},
"request": {
"orderId": 98984984985
}
}
602|{
"statusCode": 429,
"content": {
"type": "502",
"title": "TooManyRequests",
"status": 429,
"detail": "Quota exceeded. Maximum allowed: 50 per 1s.",
"instance": "CancelOrderRequest"
},
"request": {
"orderId": 98984984984
}
}
602|{
"statusCode": 409,
"content": {
"type": "502",
"title": "OrderStatusIsNotSuitableForCancelling",
"status": 409,
"detail": "Order status is not suitable for order cancelling.",
"instance": "CancelOrderRequest"
},
"request": {
"orderId": 98984984984
}
}
602|{
"statusCode": 400,
"content": {
"type": "502",
"title": "MarketOrderCouldNotBeCanceled",
"status": 400,
"detail": "Market order can not be cancelled.",
"instance": "CancelOrderRequest"
},
"request": {
"orderId": 98984984984
}
}
Order Cancelled
When the order is successfully cancelled, the server sends a private socket event:
Message Type
401
Message
401|{
"id":457889,
"accountId":"bdf248d5337d486cbed3c85a558d749f",
"pairSymbol":"AAVETRY",
"feePercentage":0.0001000000000000,
"taxPercentage":0.0000000000000000,
"initialAmount": 0.001,
"currentAmount": 0.001,
"matchedAmount": 0,
"price": 10000,
"initialTotal": 10.000999996,
"currentTotal": 10.000999996,
"matchedTotal": 0,
"method": "Limit",
"type": "Buy",
"status": "Canceled",
"externalOrderId": "hft-order-id",
"createdAt":"2024-09-10T08:31:54.3534227",
"updatedAt":"2024-09-10T08:31:56.6866329Z"
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
id | Int64 | Unique order identifier |
accountId | String | Account identifier |
pairSymbol | String | Trading pair symbol |
feePercentage | Decimal | Applied fee rate for the order |
taxPercentage | Decimal | Applied tax rate |
initialAmount | Decimal | Original order quantity |
currentAmount | Decimal | Remaining (unmatched) quantity |
matchedAmount | Decimal | Executed quantity |
price | Decimal | Order price |
initialTotal | Decimal | Original total order value |
currentTotal | Decimal | Remaining total order value |
matchedTotal | Decimal | Executed total value |
method | String | Order method (Limit, Market) |
type | String | Order side (Buy, Sell) |
status | String | Order status (Untouched, Partial, Closed, Canceled) |
externalOrderId | String | Client-provided order identifier |
createdAt | String (ISO 8601) | Order creation timestamp (UTC) |
updatedAt | String (ISO 8601) | Last update timestamp (UTC) |
Order Status Values
- Untouched
- Partial
- Closed
- Canceled
For a successful cancellation, the status will be: Canceled
Cancel All Request
Order cancellation is not guaranteed. If a matching order is already pending or being processed, the order may be executed (partially or fully) before the cancellation takes effect.
Request
The Cancel All request must be sent using only one of the following fields:
pairSymbolpairSymbolsdenominatorSymbol
These fields cannot be used together in the same request.
The Cancel All Request optionally contains following fields:
side
1. Cancel All Open Orders
504|{}
Cancels all open orders for the account.
2. Cancel by Single Pair Request
504|{
"pairSymbol": "BTCUSDT"
}
Cancels all open orders for a single trading pair.
3. Cancel by Multiple Pairs Request
504|{
"pairSymbols": ["BTCUSDT", "ETHUSDT"]
}
Cancels open orders for multiple trading pairs.
Rules
- Maximum 20 pairs
- If more than 20 pairs are provided → request rejected
- If any pair symbol is invalid → request rejected
4. Cancel by Denominator Request
504|{
"denominatorSymbol": "USDT"
}
Cancels open orders for all pairs under a specific denominator.
Rules
- Accepted values:
USDT,TRY - Any other value → request rejected
5. Cancel by Side Request
504|{
"side": 0
}
504|{
"side": 1
}
Rules:
- Accepted values for
side:- 0 ->
Buy - 1 ->
Sell - Accepts
BuyandSellas case insensitive string values.
- 0 ->
- Any other value is rejected
Cancel All Response
Message Type
604
Successful Response
If the request is accepted for processing:
401|{
"statusCode":202,
"content":{
"orderIds": [""],
"externalOrderIds": [""],
"pairSymbol": "",
"pairSymbols": [""],
"denominatorSymbol": "",
"side": 0
}
}
Error Response
All error responses follow the same schema used in other private requests (601, 602).
statusCode:400- The
contentfield follows the same error schema and semantics as the Cancel Request API
604|{
"statusCode": 400,
"content": {
"type": "504",
"title": "ErrorTitle",
"status": 400,
"detail": "Error description",
"instance": "CancelAllRequest"
},
"request": {
...
}
}
Error Scenarios
| HTTP Code | Title | Description |
|---|---|---|
400 | InvalidCancelAllRequest | Multiple filter fields were used together |
400 | PairLimitExceeded | More than 20 pair symbols provided |
400 | InvalidSymbol | One or more pair symbols are invalid |
400 | InvalidDenominatorSymbol | Denominator symbol is invalid |
429 | RateLimitExceeded | Only one cancel request per second is allowed |
500 | CancelAllFailed | Internal processing error |
Behavior Summary
Flow:
- Client sends 504
- Server returns 604
- If accepted, server emits multiple 401 order update events
- Cancellation is completed asynchronously
Get All Open Orders
This request is used to fetch open orders. You can optionally filter by pairSymbol and/or statuses.
- If you want to retrieve all orders for all symbols, set
"ps": null. - If you want to include all order statuses (only
UntouchedandPartialare supported), send"st": [].
Data source: in-memory
Examples:
503|{"ps": "BTCTRY", "st": ["Untouched", "Partial"]}
503|{"ps": null, "st": []}
- Both
ps(Pair Symbol) andst(Statuses) are optional. - Only
UntouchedandPartialorders are returned from this channel.
The response is sent through channel 603. It returns an array of open orders matching the given filters.
603|[
{
"id": "13978706", // Id
"aid": "602bc0e03fda43a1a1a203a649aa396d", // AccountId
"ps": "BTCUSDT", // PairSymbol
"fep": "0.001200", // FeePercentage
"txp": "0.000000", // TaxPercentage
"ia": "0.0549003600000000", // InitialAmount
"ca": "0.0043732200000000", // CurrentAmount
"ma": "0.0505271400000000", // MatchedAmount
"p": "89326.7900000000000000", // Price
"m": "Limit", // Method
"t": "Sell", // Type
"st": "Partial", // Status
"eid": "0c48ec75-cd3f-4bbd-95eb-13fb8fe1c3b0", // ExternalOrderId
"crt": "2025-02-25T09:35:37.303Z", // CreatedAt
"crb": "[email protected]" // CreatedBy
}
]
Field Descriptions
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the order. This ID is generated by the system and is used to reference the specific order. |
aid | string | Account ID associated with the order. Identifies the user account that placed the order. |
ps | string | Trading pair symbol. Example: BTCUSDT. Indicates the pair of assets being traded. |
fep | string | Fee percentage applied to the order, represented as a decimal. Example: 0.001200 (which equals 0.12%). |
txp | string | Tax percentage applied to the order, represented as a decimal. Example: 0.000000 (indicating no tax). |
ia | string | Initial amount specified when the order was created. This is the total quantity the user intended to trade. |
ca | string | Current amount remaining in the order. This reflects the quantity that has not yet been filled. |
ma | string | Matched amount of the order. Represents the quantity that has already been executed. |
p | string | Price at which the order was placed. Indicates the price per unit of the asset. |
m | string | Order method. Possible values: Limit, Market. Specifies how the order is executed. |
t | string | Order type. Possible values: Buy, Sell. Indicates whether the order is a buying or selling action. |
st | string | Order status. Possible values: Untouched, Partial, Filled, Cancelled. Reflects the current state of the order. |
eid | string | External order ID, represented as a UUID. This may be used for tracking orders across different systems. |
crt | string | Timestamp when the order was created, in ISO 8601 format (e.g., 2025-02-25T09:35:37.303Z). |
crb | string | Email address of the user who created the order. |
Account & Transfer Events (Private Socket)
1. Deposit Confirmed
Sent when a deposit is successfully credited to the user's account.
Message Type
404
Message
404|{
"id": "string",
"accountId": "string",
"assetId": "string",
"assetSymbol": "string",
"address": "string",
"memoTag": "string",
"amount": "string",
"transactionHash": "string",
"status": "Unknown",
"createdAt": "2025-09-03T13:51:39.068Z",
"createdBy": "string"
}
2. Withdrawal Confirmed
Sent when a withdrawal request is successfully completed.
Message Type
405
Message
405|{
"id": "string",
"accountId": "string",
"assetId": "string",
"assetSymbol": "string",
"address": "string",
"memoTag": "string",
"amount": "string",
"feeAmount": "string",
"transactionHash": "string",
"status": "Unknown",
"externalTransactionId": "string",
"createdAt": "2025-09-03T13:49:48.864Z",
"createdBy": "string",
"updatedAt": "2025-09-03T13:49:48.864Z"
}
3. Withdrawal Failed
Sent when a withdrawal request fails.
Message Type
406
Message
406|{
"id": "string",
"accountId": "string",
"assetId": "string",
"assetSymbol": "string",
"address": "string",
"memoTag": "string",
"amount": "string",
"feeAmount": "string",
"transactionHash": "string",
"status": "Unknown",
"externalTransactionId": "string",
"createdAt": "2025-09-03T13:49:48.864Z",
"createdBy": "string",
"updatedAt": "2025-09-03T13:49:48.864Z"
}
4. Internal Fund Transfer
Sent when an internal balance transfer occurs between accounts.
Message Type
403
Message
403|{
"id": "string",
"senderAccountId": "string",
"receiverAccountId": "string",
"amount": 0,
"brokerCurrencyId": "string",
"corporateId": "string",
"status": "Unknown",
"failReason": "string",
"createdAt": "2025-09-03T14:02:03.216Z",
"createdBy": "string",
"updatedAt": "2025-09-03T14:02:03.216Z",
"updatedBy": "string"
}
Common Field Descriptions
| Field | Type | Description |
|---|---|---|
id | String | Unique transaction identifier |
accountId | String | User account identifier |
assetId | String | Internal asset identifier |
assetSymbol | String | Asset symbol (e.g., BTC, USDT) |
address | String | Blockchain address |
memoTag | String | Memo / Tag (if applicable) |
amount | Decimal (String) | Transaction amount |
feeAmount | Decimal (String) | Network fee amount |
transactionHash | String | Blockchain transaction hash |
externalTransactionId | String | External reference ID |
status | String | Current transaction status |
createdAt | String | Creation timestamp (ISO 8601, UTC) |
updatedAt | String | Last update timestamp |
failReason | String | Failure description (if applicable) |
Status Values
Depending on the event type:
PendingConfirmedFailedCompleted
Behavior Notes
- These messages are event-driven.
- They are sent only to the related authenticated account.
- Clients should rely on the
idorexternalTransactionIdfield for idempotent processing.