Overview

Rate Limit: 1 requests per 1 seconds per apiKey

Authenticate your connection to the algo orders WebSocket. All push channels (ALGO_ORDER, SUB_ORDER, SUB_TRADE) and order actions (place_algo_order, cancel_algo_order, replace_algo_order) are only available after a successful login.

Rate Limit: 1 request per second per API key

WebSocket URL: wss://wss.liquiditytech.com/v1/private-algo


Authentication

Connect to the WebSocket URL above and send a login message immediately. The server will not push any data until login succeeds.

{
  "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()
FieldTypeRequiredDescription
actionStringYMust be login.
args.apiKeyStringYYour API key.
args.timestampStringYCurrent Unix timestamp in seconds (10 digits). Millisecond values are rejected with 601016.
args.signStringYHMAC-SHA256 signature (see above).

Response

Success:

{
  "event": "login",
  "code": 0,
  "msg": ""
}

Failure:

{
  "event": "login",
  "code": 601009,
  "msg": "Login failed"
}

A timestamp outside the accepted range, including a 13-digit millisecond value, returns 601016Login failed, invalid nonce.

FieldTypeDescription
eventStringAlways login — on success and on failure alike. Do not use it as an outcome flag.
codeInteger0 = login successful. Any other value indicates an error.
msgStringEmpty on success, or an error message on failure.

Heartbeat

The connection will automatically disconnect if no data is received for 30 seconds. Send a ping periodically to keep it alive.

Client sends: ping

Server responds: pong

Set a timer after each received message. If no data arrives within N seconds (N < 30), send "ping". If no "pong" is received in response, reconnect.