Skip to main content

Subscribe Funding Fee Rate

API Description

This websocket allows querying the real-time funding fee rate for a specified trading instrument.

Note: Funding Fee Rate data is available via both Resful and Websocket APIs. This page describes the Websocket API. For information on the RESTful API, please click here

Precautions

  1. The RESTful API provides funding rate information from the last settlement. However, Websocket API and webpage delivers real-time funding rate updates.

Authentication

This is a public websocket and does not require authentication. For details on using the Websocket API, please refer to Introduction > Authentication & Code Snippet > Futures > Websocket Public Interface.

Websocket URL

wss://ws.futurescw.com/perpum

Frequency Limit

None

Subscription Parameters

ParameterMandatoryTypeDescription
eventtrueStringSubscribe or unsubscribe. sub: subscribe; unsub: unsubscribe.
Note: This parameter is case-sensitive.
paramstrueJsonRequested parameter objects including:
-biztrueStringSpecifies the channel, e.g., "futures"
Note: Lowercase is recommended.
-typetrueStringDefines the function type, e.g., "funding_rate"
Note: Lowercase is recommended.
-pairCodetrueStringThe base currency of the instrument. (e.g., BTC or btc). This parameter is case-insensitive.
Note: For instruments that start with numbers (e.g., 1000PEPE), both uppercase and lowercase formats are valid.

Response Parameters

ParameterTypeDescription
bizStringSpecifies the channel, e.g., 'futures".
typeStringDefines the function type, e.g., "funding_rate"
resultbooleanIndicates whether the subscription or unsubscription was successful: true, false.
channelStringSpecifies the action performed: subscribe or unsubscribe.
pairCodeStringBase currency of the instrument, e.g., BTC.
dataJsonData object, containing the following fields:
-rbig DecimalFunding fee rate
-ntLongTimestamp (unix)
-nstringBase currency of the instrument, e.g., btc

Subscription Example

The following Python code shows how to subscribe to funding fee rate for "BTC".

Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Futures > Websocket Public Interface.

subscription_params =  { "event": "sub",
"params": {
"biz": "futures",
"pairCode": "BTC",
"type": "funding_rate"}}

url = "wss://ws.futurescw.com/perpum"
FuturesWebsocketPublic(url, subscription_params) #function FuturesWebsocketPublic() is defined in section (Introduction > Authentication & Code Snippet > Futures > Websocket Public Interface)

Note: For a complete Java code example, please refer to Introduction > Authentication & Code Snippet > Futures > Websocket Public Interface.

Response Example

The Websocket subscription will keep updating the funding fee rate in real-time. For brevity, only the initial response for python subscrption is provided below:

{'biz': 'futures',
'pairCode': 'BTC',
'data': {'result': True},
'channel': 'subscribe',
'type': 'funding_rate'}
{'biz': 'futures',
'pairCode': 'btc',
'data': {'r': 4.926e-05, 'nt': 1745490090000, 'n': 'btc'},
'type': 'funding_rate'},.....