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/infoRequest
Request Format
{
"id": "funding-1",
"method": "post",
"params": {
"action": "getFundingRate",
"symbol": "BTC-USDT"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Client-generated unique request identifier |
method | string | Yes | Must be "post" |
params | object | Yes | Request parameters wrapper |
params.action | string | Yes | Must be "getFundingRate" |
params.symbol | string | Yes | Trading 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
| Field | Type | Description |
|---|---|---|
result.response.symbol | string | Trading pair symbol (e.g., "BTC-USDT") |
result.response.estimatedFundingRate | string | Estimated funding rate for the next settlement period as a decimal string |
result.response.lastSettlementRate | string | The actual funding rate from the most recent settlement as a decimal string |
result.response.lastSettlementTime | integer | Timestamp of the last funding settlement in milliseconds since epoch |
result.response.nextFundingTime | integer | Next funding time in milliseconds since epoch |
result.response.fundingInterval | integer | Funding interval in milliseconds (e.g., 3600000 for 1 hour) |
result.status | string | Always "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
- Market Price Updates - Real-time price feeds
- Get Market Prices - Comprehensive market prices
- REST Alternative - HTTP request for funding rate