订阅源
518 字约 2 分钟
2026-09-18
概述
GET /v1/feed 提供 WebSocket 实时行情推送服务。连接成功后,您将自动接收来自 Robinhood Chain 的实时 Feed 数据流,无需额外的订阅操作。
连接方式
WebSocket wss://robinhood-ohio.flashblock.trade/v1/feed请求头
| Header | 必需 | 说明 |
|---|---|---|
X-User-ID | 是 | 您的 API Key |
连接示例
JavaScript:
const ws = new WebSocket('wss://robinhood-ohio.flashblock.trade/v1/feed', {
headers: {
'X-User-ID': '<your-api-key>'
}
});
ws.onopen = () => {
console.log('Feed connected');
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Feed:', data);
};
ws.onclose = (event) => {
console.log('Disconnected:', event.code, event.reason);
// 建议实现自动重连逻辑
};wscat (命令行):
wscat -c "wss://robinhood-ohio.flashblock.trade/v1/feed" \
-H "X-User-ID: <your-api-key>"Python:
import asyncio
import websockets
import json
async def feed_client():
uri = "wss://robinhood-ohio.flashblock.trade/v1/feed"
headers = {"X-User-ID": "<your-api-key>"}
async with websockets.connect(uri, extra_headers=headers) as ws:
async for message in ws:
data = json.loads(message)
print(f"Feed: {data}")
asyncio.run(feed_client())连接配额
不同套餐等级的 Feed 连接限制:
| 套餐 | 最大并发连接数 |
|---|---|
| Free | 不可用 |
| Advanced | 1 |
| Premium | 1 |
- Free 用户连接 Feed 将收到
403 feed_not_entitled错误 - 超出连接数限制将收到
429 feed_limit_exceeded错误 - 关闭已有连接后即可建立新连接
详细套餐信息请参阅 套餐与定价。
连接保持
Gateway 会自动发送 WebSocket Ping 帧维持连接。您的客户端需正常响应 Pong 帧(大多数 WebSocket 库会自动处理),否则连接将在超时后断开。
建议的客户端行为
- 自动重连 -- 实现断线重连逻辑,建议使用指数退避策略(初始 1 秒,最大 30 秒)
- 消息处理 -- 及时消费收到的消息,避免消息堆积导致丢失
- 心跳响应 -- 确保您的 WebSocket 库能够自动回复 Pong 帧
Benchmark
快照时间:2026-09-22T06:43:43Z,测试区块总数:291
| Sequencer Feed | Win rate | P50 | P90 | P95 | P99 |
|---|---|---|---|---|---|
| Robinhood Gateway Feed | 92.44% | 0 ms | 0 ms | 8.041 ms | 34.037 ms |
| Robinhood Chain Sequencer Feed | 7.56% | 2.809 ms | 23.688 ms | 37.332 ms | 62.767 ms |
Gateway 胜率达到 92.44%,P50 相对延迟为 0ms,P99 仅 34ms,表明 Hub fan-out 广播的核心转发延迟极低。测试实现 100% 区块匹配,零丢块、零断线。