Structure of websocket response
WebSocket Response Documentation
This document outlines the structure and details of the WebSocket responses for trades, including both success and failure cases.
Success Responses
1. Trade Success Response
{
"id": "f9b708b8-c9d0-4f67-9299-1422e06db9dc",
"pair": "BTC/EUR",
"trade_type": "sell",
"order_type": "limit",
"status": "filled",
"time_force": "GoodTillCancel",
"client_id": null,
"amount": 101.754,
"volume": 0.001,
"price": 180000,
"trading_fee_amount": "1.018",
"trading_fee_percentage": "0.001",
"created_at": 1734440907
}
Fields
- id (string): Unique identifier for the trade.
- pair (string): Trading pair, e.g., BTC/EUR.
- trade_type (string): Type of trade, e.g.,
sell
orbuy
. - order_type (string): Type of order, e.g.,
limit
ormarket
. - status (string): Status of the trade, e.g.,
filled
. - time_force (string): Time in force, e.g.,
GoodTillCancel
. - client_id (string|null): Client-specified identifier, or
null
if not provided. - amount (float): Total amount of the trade.
- volume (float): Volume of the trade.
- price (float): Price per unit of the asset.
- trading_fee_amount (string): Fee amount apply.
- trading_fee_percentage (string): Fee percentage apply.
- created_at (integer): UNIX timestamp for trade creation.
2. Status Update Response
{
"id": "f9b708b8-c9d0-4f67-9299-1422e06db9dc",
"status": "New"
}
Fields
- id (string): Unique identifier for the trade.
- status (string): Current status of the trade, e.g.,
New
.
Failure Responses
1. Liquidity Provider (LP) Error Response
{
"id": "4e038348-1000-41c5-a0ce-b8f4764c2161",
"pair": "BTC/USDT",
"trade_type": "sell",
"order_type": "limit",
"status": "rejected",
"time_force": "GoodTillCancel",
"client_id": null,
"amount": 10.49837,
"volume": 0.0001,
"price": 180000,
"created_at": 1734526097,
"error": "invalid quantity: 0.000100 BTC, must be 0.5 BTC or greater"
}
Fields
- id (string): Unique identifier for the trade.
- pair (string): Trading pair, e.g., BTC/EUR.
- trade_type (string): Type of trade, e.g.,
sell
orbuy
. - order_type (string): Type of order, e.g.,
limit
ormarket
. - status (string): Status of the trade, e.g.,
filled
. - time_force (string): Time in force, e.g.,
GoodTillCancel
. - client_id (string|null): Client-specified identifier, or
null
if not provided. - amount (float): Total amount of the trade.
- volume (float): Volume of the trade.
- price (float): Price per unit of the asset.
- created_at (integer): UNIX timestamp for trade creation.
- error (string): Error message detailing the issue, e.g., invalid quantity.
2. Depasify Error Response
{
"errors": [
{
"code": "pair_not_permitted",
"message": "Pair not permitted"
}
]
}
Fields
errors (array): List of error objects.
code (string): Error code, e.g., pair_not_permitted.
message (string): Description of the error, e.g., Pair not permitted.
Notes
- All timestamps (
created_at
) are in UNIX epoch format. - Trade IDs are unique and used to track individual trades across the system.
- Ensure to handle errors gracefully in client implementations.