Skip to main content
TWAP order entry is performed over WebSocket.
  • 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.com using the add_twap incoming message.
  • A successful TWAP is returned as twap_response and also appears in all_orders_response.twaps.
  • TWAPs can be cancelled with cancel_order using cancel_order_id_type set to twap_id or client_twap_id.
  • The account must satisfy the same T&C requirements as standard order entry.

Validation Rules

The server validates add_twap requests before forwarding them to the TWAP service. Additional implementation notes:
  • total_quantity is scaled using the symbol quantity precision before validation.
  • The current validation shown here does not document any explicit requirement that total_quantity align to lot_size, only that the average child size is not below min_quantity.
  • Errors from local validation are returned as err with error_code: "invalid_parameter" and a descriptive message.

Sample Code

TWAP Response Shape

Successful TWAP requests are returned as a twap_response object: