跳到主要内容

24h价格变动情况

接口描述

24小时行情统计以订阅推送流方式提供,而不是请求/响应式调用。连接 wss://api.prex.world/ws 并订阅 ticker:{symbol} 频道。

订阅成功后,服务器会立即推送一次快照,随后每 2 秒推送一次更新。

订阅

{
"type": "subscribe",
"channel": "ticker:BTCUSDT"
}

推送示例

{
"type": "ticker",
"symbol": "BTCUSDT",
"last_price": "65432.10",
"mark_price": "65433.00",
"index_price": "65431.50",
"price_change_24h": "1200.50",
"price_change_percent_24h": "1.87",
"high_24h": "66000.00",
"low_24h": "64000.00",
"volume_24h": "12345.6789",
"volume_24h_usd": "807654321.00",
"open_interest_long": "5000.0000",
"open_interest_short": "4200.0000",
"open_interest_long_percent": "54",
"open_interest_short_percent": "46",
"available_liquidity_long": "1500000.00",
"available_liquidity_short": "1200000.00",
"funding_rate_long_1h": "+0.0050%",
"funding_rate_short_1h": "-0.0050%"
}

连接方式参见 WebSocket API 基本信息。如需 REST 快照,请使用 GET /fapi/v1/ticker/24hr