Private WebSocket for real-time account updates and order management.
After authenticating, the server automatically pushes real-time updates for your orders, trade executions, asset balances, positions, and margin calls. You can also place, replace, and cancel orders directly over the same WebSocket connection without needing separate REST API calls.
WebSocket URL: wss://wss.liquiditytech.com/v1/private
Supported exchanges: BINANCE / OKX / EDX
Connection
Connect to the WebSocket URL above and send a login request immediately. All private channels require authentication — the server will not push any data until login succeeds.
The server may disconnect due to cloud service abnormalities or system updates. Implement automatic reconnection logic in your client to handle this gracefully.
Authentication
Send a login message immediately after connecting. All subsequent push data and order actions are only available after a successful login response.
{
"action": "login",
"args": {
"apiKey": "your_api_key",
"timestamp": "1538054050",
"sign": "your_signature"
}
}
Signature: HMAC-SHA256(secret, timestamp + "GET" + "/users/self/verify"), hex-encoded.
import hmac, hashlib, time
timestamp = str(int(time.time()))
message = timestamp + "GET" + "/users/self/verify"
sign = hmac.new(secret.encode(), message.encode(), hashlib.sha256).hexdigest()
Success response:
{ "id": null, "event": "login", "code": 0, "msg": "", "data": null }
Failure response:
{ "event": "error", "code": "60009", "msg": "Login failed." }
| Field | Type | Required | Description |
|---|---|---|---|
args.apiKey | String | Yes | Your API key |
args.timestamp | String | Yes | Current Unix timestamp in seconds |
args.sign | String | Yes | HMAC-SHA256 signature (see above) |
args.onlyTrade | Boolean | No | Default false; set true to restrict this connection to order actions only (no push data) |
Rate Limits
| Action | Limit |
|---|---|
| Login | 1 request per second per API key |
| Place Order | 1200 requests per 60 seconds |
| Replace Order | 300 requests per 60 seconds |
| Cancel Order | 1200 requests per 60 seconds |
| Cancel Orders (Batch) | 1200 requests per 60 seconds |
Heartbeat
The connection will automatically disconnect if no data is received for 30 seconds. Send a ping periodically to keep it alive.
Client ping:
ping
Server response:
pong
Set a timer after each received message. If no data arrives within N seconds (N < 30), send a "ping". If no "pong" is received in response, reconnect.
Available Pages
| Page | Description |
|---|---|
| User Data | Real-time push: orders, trades, assets, positions, margin calls |
| Place Order | Submit a new order over WebSocket |
| Replace Order | Amend the price or quantity of an open order |
| Cancel Order | Cancel a single order by order ID or client order ID |
| Cancel Orders | Cancel all open orders, optionally filtered by exchange |
