- Endpoint:
wss://trade.qfex.com?api_key=YOUR_API_KEY - Authenticate within 1 minute of connecting.
1) Authenticate
Send this immediately after you connect:2) Add TWAP
Parameters
⚠️ Notes:
- TWAP orders are submitted to
trade.qfex.comusing theadd_twapincoming message.- A successful TWAP is returned as
twap_responseand also appears inall_orders_response.twaps.- TWAPs can be cancelled with
cancel_orderusingcancel_order_id_typeset totwap_idorclient_twap_id.- The account must satisfy the same T&C requirements as standard order entry.
Validation Rules
The server validatesadd_twap requests before forwarding them to the TWAP service.
Additional implementation notes:
total_quantityis scaled using the symbol quantity precision before validation.- The current validation shown here does not document any explicit requirement that
total_quantityalign tolot_size, only that the average child size is not belowmin_quantity. - Errors from local validation are returned as
errwitherror_code: "invalid_parameter"and a descriptivemessage.
Sample Code
TWAP Response Shape
Successful TWAP requests are returned as atwap_response object: