Skip to main content
WSS

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.

Messages
api_key
type:httpApiKey

Provide your public key as a query parameter (?api_key=...).

jwt
type:httpApiKey

Provide your JWT as a query parameter (?jwt=...).

Authenticate
type:object

Authenticate to the WebSocket gateway. Required before any other commands.

Subscribe to Orders
type:object

Subscribe to user orders. Receive live updates on current orders.

Subscribe to Positions
type:object

Subscribe to user positions. Receive 1s pulsed updates on current positions.

Subscribe to Balance
type:object

Subscribe to user balance. Receive 1s pulsed updates on current balance.

Subscribe to Fills
type:object

Subscribe to user fills. Receive live updates for executed trades.

Get Leverage
type:object

Get current leverage levels per symbol

Set Leverage
type:object

Set leverage level for a symbol

Get Available Leverage
type:object

Get available leverage levels per symbol

Add Order
type:object

Add order.

Cancel Order
type:object

Cancel order.

Modify Order
type:object

Modify order.

Get Order
type:object

Get order details by order_id or client_order_id.

Get User Orders
type:object

Get active orders for the user.

Cancel On Disconnect
type:object

Enable or disable cancel-on-disconnect feature for this connection.

Close Position
type:object

Close an open position.

Add TWAP
type:object

Create a TWAP order.

Get User Trades
type:object

Get user trade history.

Cancel Stop Order
type:object

Cancel a stop order.

Modify Stop Order
type:object

Modify a stop order.

Unsubscribe
type:object

Unsubscribe from channels.

Balance Update

User balance updates

Example: {"type":"subscribed","connection_id":"ee987ddf-822c-4356-b0d1-012314859b00","message_id":1,"id":"3ab267fd-7c83-49c6-b42e-65bb94682b41","channel":"v4_balances","contents":[{"id":"2cb208e3-6e54-48c4-82e9-641e64bf185d","user_id":"0f5208e3-6e54-48c4-82e9-641e64bf185d","deposit":1000,"realised_pnl":-898.65735,"unrealised_pnl":0,"order_margin":0,"position_margin":0,"net_funding":-1.5354636,"available_balance":99.80721}]}
Position Update

User position updates

Example: {"type":"subscribed","connection_id":"ee987ddf-822c-4356-b0d1-012314859b00","message_id":1,"id":"3ab267fd-7c83-49c6-b42e-65bb94682b41","channel":"v4_positions","contents":[{"id":"PLTR-USD","symbol":"PLTR-USD","user_id":"0f5208e3-6e54-48c4-82e9-641e64bf185d","position":0,"margin_alloc":0,"realised_pnl":1.327875,"unrealised_pnl":0,"net_funding":0.00000482,"open_orders":1,"open_quantity":10,"leverage":20,"initial_margin":0,"maintenance_margin":0,"average_price":0,"timestamp":"2025-05-09T03:47:20.505934+00:00"}]}
Order Response
type:object

Response containing a single order.

Fill Response
type:object

Response containing a single fill.

All Orders Response
type:object

Response containing a list of orders.

Authenticated Response
type:object

Response indicating authentication success.

User Trades Response
type:object

Response containing user trades.

User Leverage Response
type:object

Response containing user leverage settings.

Available Leverage Levels Response
type:object

Response containing available leverage levels.

Subscribed Response
type:object

Confirmation of subscription.

Unsubscribed Response
type:object

Confirmation of unsubscription.

Stop Order Response
type:object

Response containing a stop order.

Position Response
type:object

Response containing a position.

Balance Response
type:object

Response containing a balance.

Acknowledgment Response
type:object

General acknowledgment.

Error Response
type:object

Error response.