Skip to content

Get Funding Rate (WebSocket)

Retrieve current funding rates for perpetual markets through the WebSocket connection. This is a public endpoint that returns market-wide funding rate information without requiring authentication.

Endpoint

ws.send() wss://api.synthetix.io/v1/ws/info

Request

Request Format

{
  "id": "funding-1",
  "method": "post",
  "params": {
    "action": "getFundingRate",
    "symbol": "BTC-USDT"
  }
}

Request Parameters

ParameterTypeRequiredDescription
idstringYesClient-generated unique request identifier
methodstringYesMust be "post"
paramsobjectYesRequest parameters wrapper
params.actionstringYesMust be "getFundingRate"
params.symbolstringYesTrading pair symbol (e.g., "BTC-USDT")

Response

Success Response

{
  "id": "funding-1",
  "status": 200,
  "result": {
    "response": {
      "symbol": "BTC-USDT",
      "estimatedFundingRate": "0.000010960225996",
      "lastSettlementRate": "0.0001",
      "lastSettlementTime": 1704066000000,
      "nextFundingTime": 1704067200000,
      "fundingInterval": 3600000
    },
    "status": "success"
  }
}

Response Fields

FieldTypeDescription
result.response.symbolstringTrading pair symbol (e.g., "BTC-USDT")
result.response.estimatedFundingRatestringEstimated funding rate for the next settlement period as a decimal string
result.response.lastSettlementRatestringThe actual funding rate from the most recent settlement as a decimal string
result.response.lastSettlementTimeintegerTimestamp of the last funding settlement in milliseconds since epoch
result.response.nextFundingTimeintegerNext funding time in milliseconds since epoch
result.response.fundingIntervalintegerFunding interval in milliseconds (e.g., 3600000 for 1 hour)
result.statusstringAlways "success" for successful responses

Error Response

{
  "id": "funding-1",
  "status": 400,
  "result": null,
  "error": {
    "code": 400,
    "message": "Invalid symbol"
  }
}

WebSocket Connection Example

const ws = new WebSocket('wss://papi.synthetix.io/v1/ws/info');
 
ws.onopen = () => {
  // Request funding rate for BTC-USDT
  ws.send(JSON.stringify({
    id: 'funding-1',
    method: 'post',
    params: {
      action: 'getFundingRate',
      symbol: 'BTC-USDT'
    }
  }));
};
 
ws.onmessage = (event) => {
  const response = JSON.parse(event.data);
 
  if (response.id === 'funding-1' && response.status === 200) {
    const data = response.result.response;
    console.log('Funding Rate:', data);
    console.log(`Estimated Rate: ${data.estimatedFundingRate}`);
    console.log(`Last Settlement Rate: ${data.lastSettlementRate}`);
    console.log(`Last Settlement: ${new Date(data.lastSettlementTime)}`);
    console.log(`Next Funding: ${new Date(data.nextFundingTime)}`);
  }
};

Examples

Get Funding Rate for BTC

{
  "id": "btc-funding",
  "method": "post",
  "params": {
    "action": "getFundingRate",
    "symbol": "BTC-USDT"
  }
}

Get Funding Rate for ETH

{
  "id": "eth-funding",
  "method": "post",
  "params": {
    "action": "getFundingRate",
    "symbol": "ETH-USDT"
  }
}

Implementation Notes

  • Public Data: No authentication required for this endpoint
  • Symbol Required: A valid market symbol must be provided
  • Funding Periods: Funding rates are updated at regular intervals (typically every 8 hours)
  • Real-time Updates: For continuous funding rate updates, consider polling or using subscriptions
  • Precision: Funding rates are returned as decimal strings for precision

Use Cases

Risk Management

  • Monitor funding costs for open positions
  • Calculate funding payment projections
  • Assess carry costs for long-term positions

Trading Strategy

  • Identify funding rate arbitrage opportunities
  • Adjust position sizes based on funding costs
  • Time entries/exits around funding periods

Market Analysis

  • Track funding rate trends
  • Compare funding rates across markets
  • Analyze market sentiment through funding data

Performance Considerations

  • Low Latency: WebSocket connection provides faster response times than REST
  • Persistent Connection: Reuse the same connection for multiple requests
  • Market-Specific: Request only the markets you need
  • Caching: Funding rates change infrequently, suitable for short-term caching

Validation Rules

  • No authentication required (public Info WebSocket)
  • Symbol parameter is required and must be a valid market symbol
  • Invalid symbols will return a 400 error

Related Endpoints