Skip to main content
QFEX provides a stream of the current funding rate for any symbol, representing the rate if the funding window were to end right now.
At the end of each funding window, the final rate is used to compute funding payments. The streamed value is the post-scaling final rate: Ffinal=Fraw/100F_{\text{final}} = F_{\text{raw}} / 100.
Funding is only active during each symbol’s configured market hours. Outside those hours, funding rate is 0. See /qfex/funding.

How it works

Connect to the public websocket:
  • URL: wss://mds.qfex.com
Then send a subscribe message:
{
  "type": "subscribe",
  "channels": ["funding"],
  "symbols": ["AAPL-USD", "US500-USD"]
}

Sample Code

# Python (websocket-client)
# pip install websocket-client
import json
import websocket

def on_open(ws):
    sub = {
        "type": "subscribe",
        "channels": ["funding"],
        "symbols": ["US500-USD"]  # or ["*"]
    }
    ws.send(json.dumps(sub))

def on_message(ws, message):
    data = json.loads(message)
    print("Funding update:", json.dumps(data, indent=2))

def on_error(ws, error):
    print("Error:", error)

def on_close(ws, close_status_code, close_msg):
    print("Closed:", close_status_code, close_msg)

if __name__ == "__main__":
    ws = websocket.WebSocketApp(
        "wss://mds.qfex.com",
        on_open=on_open,
        on_message=on_message,
        on_error=on_error,
        on_close=on_close,
    )
    ws.run_forever()

Example Response

{
  "type": "funding",
  "sequence": 50,
  "time": "2014-11-07T08:19:27.028459Z",
  "symbol": "AAPL-USD",
  "time_remaining": 30, //in seconds
  "funding_rate": "0.021"
}

Unsubscribe (optional)

{ "type": "unsubscribe", "channels": ["funding"], "symbols": ["US500-USD"] }

Notes
  • Represents the current implied funding rate if the window ended immediately.
  • Pulsed during funding calculation window.
  • Outside symbol market hours, funding rate = 0.