Skip to main content
This endpoint is only available to Growth and Enterprise plans.

Endpoint Details

  • URL: wss://api.mobula.io
  • Event Type: funding

Subscription Format

Subscribe to funding rates for specific trading pairs:

Parameters

  • symbol (required): Trading symbol (e.g., "BTC", "ETH").
  • quote (optional): Quote asset (e.g., "USDT", "USD"). Defaults depend on exchange pairs
  • exchange (optional): Comma-separated list of exchanges - binance, bybit, deribit, okx, hyperliquid, gate, lighter, kucoin, mexc, bitget, kraken, coinbase
  • protocol (optional): Hyperliquid only. One of xyz, flx, vntl, hyna, km, cash. When set, used as symbol prefix (e.g. protocol: "cash" with symbol: "HOOD"cash:HOOD). Alternative to putting the prefix in the symbol (e.g. symbol: "cash:HOOD").
  • interval (optional): Refresh interval in seconds for updates
  • subscriptionId (optional): Unique identifier for your WebSocket connection. Auto-generated if not provided
  • subscriptionTracking (optional, default: false): Include subscription details in response logs for debugging
Supported Exchanges: Binance, Bybit, Deribit, OKX, Hyperliquid, Gate.io, Lighter, KuCoin, MEXC, Bitget, Kraken, Coinbase

Hyperliquid DEX (HIP3) Usage

Funding rates from Hyperliquid are available only for HIP3 perpetuals:
  • Symbol prefix: Use a colon in the symbol (e.g., "cash:HOOD", "dex:BTC", "xyz:XYZ100"), or
  • protocol parameter: Set protocol to one of xyz, flx, vntl, hyna, km, cash with the base symbol (e.g. symbol: "HOOD", protocol: "cash" → same as cash:HOOD).
  • Include exchange: "hyperliquid" in the payload.
Example (symbol prefix):
Gate.io Note: Uses usdt as the settle currency. Contracts are in format SYMBOL_USDT (e.g., BTC_USDT).
Lighter Note: Funding rate sign convention - positive rate means longs pay shorts, negative rate means shorts pay longs. Epoch duration is 1 hour.
Bitget Note: quote selects the contract type - USDTusdt-futures (ticker ETHUSDT), USDCusdc-futures (ticker ETHPERP), USD → coin-margined coin-futures. Defaults to USDT.
Example (protocol parameter):

Response Format

Each funding rate update includes data from all requested exchanges:

Implementation Example

You can use the Network tab in your browser to see the WebSocket requests and responses in real-time.

Connection Keepalive (Ping/Pong)

To maintain active WebSocket connections and prevent timeouts, you can use the ping/pong mechanism: Send ping:
Receive pong: The server will respond with a pong message to confirm the connection is active.
Use ping messages periodically (every 30-60 seconds) to keep long-lived connections alive.

Unsubscribing from the Stream

Unsubscribe from All Streams

To terminate all active subscriptions on the current WebSocket connection:

Unsubscribe from Specific Subscription

To unsubscribe from a specific subscription using its ID:

Unsubscribe from All Funding Streams

To unsubscribe from all funding streams while keeping other stream types active:
If you didn’t provide a subscriptionId when subscribing, one is auto-generated. To retrieve it, set "subscriptionTracking": true in the subscription payload.

Support

Can’t find what you’re looking for? Reach out to us, response times < 1h.

Support

Telegram

Support

Slack

Need help?

Email