Documentation Index
Fetch the complete documentation index at: https://docs.qfex.com/llms.txt
Use this file to discover all available pages before exploring further.
You can request all open orders (including partially filled orders) and active TWAPs for the authenticated account.
Example Request
{
"type": "get_user_orders",
"params": {
"limit": 10,
"offset": 0,
"symbol": "AAPL-USD"
}
}
limit (optional) — maximum number of orders to return (default 1000)
offset (optional) — pagination offset (default 0)
symbol (optional) — symbol to filter by. Will return all orders if not specified.
Sample Code
# Python (websocket-client)
import json, websocket
API_KEY = "YOUR_API_KEY"
def send(ws, obj): ws.send(json.dumps(obj))
def on_open(ws):
# Authenticate
# https://docs.qfex.com/websocket/channels/trade/authenticate#how-it-works
send(ws, {"type": "auth", "params": { "hmac": { "public_key": "qfex_pub_xxxxx", "nonce": "c0ffee...", "unix_ts": 1760545414, "signature": "5f2e..." }}})
# Request user orders
send(ws, {"type": "get_user_orders", "params": {"limit": 10, "offset": 0, "symbol": "AAPL-USD"}})
ws = websocket.WebSocketApp(
"wss://trade.qfex.com?api_key=YOUR_API_KEY",
on_open=on_open,
on_message=lambda _, m: print("Message:", m)
)
ws.run_forever()
Example Response
{
"all_orders_response": {
"orders": [
{
"order_id": "2f05173c-992a-426b-bcaf-6b341644bb62",
"symbol": "GOOG-USD",
"status": "ACK",
"quantity": 2.708,
"price": 251.25,
"take_profit": 0.0,
"stop_loss": 0.0,
"side": "SELL",
"type": "LIMIT",
"time_in_force": "GTC",
"user_id": "0020ce8e-eaee-480e-8d7f-b9241d756ee5",
"client_order_id": "7a257796-a9c1-49bd-a80b-bcccdc81c103",
"quantity_remaining": 2.708,
"update_time": 1758208770.5512846,
"trade_id": null
}
],
"twaps": [
{
"twap_id": "0c7c8e4d-f67e-4aa5-9c64-36a1a622ac35",
"client_twap_id": "rebalance-aapl-001",
"user_id": "0020ce8e-eaee-480e-8d7f-b9241d756ee5",
"status": "ENGINE_STATUS",
"symbol": "GOOG-USD",
"total_quantity": 5,
"filled_quantity": 1,
"average_fill_price": 251.25,
"total_num_orders": 5,
"order_interval_secs": 30,
"reduce_only": false,
"side": "SELL",
"updated_at": 1758208770.5512846,
"created_at": 1758208700.5512846
}
]
}
}
Only open orders and active TWAPs are returned. Filled and fully
cancelled orders are not included.