> For the complete documentation index, see [llms.txt](https://docs.blockrazor.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blockrazor.io/tc/streams/node-stream/robinhood-chain/direct-sequencer-feed.md).

# Robinhood Chain Direct Sequencer Feed 接入指南

瞭解 Robinhood Chain Sequencer Feed 服務、價格、端點和使用步驟

### Direct Sequencer Feed是什麼

相比Node-required Sequencer Feed，Direct Sequencer Feed 無需部署節點，普通客戶端即可直接接收最新區塊，以更低延遲追蹤鏈上信號，適合狙擊、跟單等不依賴完整節點狀態同步的場景。

需要注意的是，Direct Sequencer Feed在網絡擁堵期間可能出現跳塊現象。

<details>

<summary><strong>Node-required Sequencer Feed 和 Direct Sequencer Feed 有什麼區別</strong></summary>

<table><thead><tr><th width="108.69921875">對比項</th><th width="261.37109375">Node-required Sequencer Feed</th><th>Direct Sequencer Feed</th></tr></thead><tbody><tr><td>接入方式</td><td>需要通過節點接收</td><td>普通客戶端可直接接入，無需運行節點</td></tr><tr><td>區塊傳輸</td><td>按区块高度顺序传输，不跳块</td><td>優先提供最新區塊，網絡擁塞時允許跳過中間區塊</td></tr><tr><td>節點狀態依賴</td><td>依赖节点低延遲同步状态</td><td>不依赖本地节点保持完整、连续的状态同步</td></tr><tr><td>部署成本</td><td>需要部署、維護和監控節點</td><td>接入簡單，運維成本較低</td></tr><tr><td>適合場景</td><td>套利、訂單流項目、量化交易</td><td>狙擊、跟單</td></tr></tbody></table>

</details>

### 高性能 JSON 解析

接入 Robinhood Chain Direct Sequencer Feed 的 Go 客戶端，可使用 [ByteDance Sonic](https://github.com/bytedance/sonic) 解析通過 WebSocket 接收的 JSON 消息。Sonic 利用 JIT 和 SIMD 技術加速序列化與反序列化，可以有效降低交易策略在消息解析環節的延遲和 CPU 開銷。

經實測，Sonic 的 JSON 解析延遲 **P50 約為 2–3 微秒**。實際性能仍會受到消息大小、數據結構、CPU 架構及運行環境的影響，建議使用真實 Feed 數據進行基準測試，並在正式處理延遲敏感型流量前完成預熱。

目前我們提供的參考實現以 **Go** 為主。如果客戶端交易策略使用 Rust、C++等其他語言，可以參考上述延遲基準，選擇對應語言的高性能 JSON 解析庫，並在自身生產環境中完成性能驗證。

### 價格

價格為$80 / stream / 日和$800 / stream / 月。 <a href="https://blockrazor.io/#/login?redirect=pricing&#x26;purchaseMode=personalized&#x26;chain=robinhood&#x26;serviceId=robinhood_direct_feed_stream&#x26;billing=day" class="button primary small">訂閱</a>

### 端點

{% tabs %}
{% tab title="ws" %}

<table><thead><tr><th width="152.515625">地区</th><th>端点</th></tr></thead><tbody><tr><td>俄亥俄</td><td>ws://us.robinhood-feeder.blockrazor.io/ws/direct/{authToken}</td></tr></tbody></table>
{% endtab %}

{% tab title="wss" %}

<table><thead><tr><th width="152.515625">地区</th><th>端点</th></tr></thead><tbody><tr><td>俄亥俄</td><td>wss://us.robinhood-feeder.blockrazor.io/ws/direct/{authToken}</td></tr><tr><td>東京</td><td>wss://jp.robinhood-feeder.blockrazor.io/ws/direct/{authToken}</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### 使用步驟

{% stepper %}
{% step %} <a href="https://blockrazor.io/#/login?redirect=pricing&#x26;purchaseMode=personalized&#x26;chain=robinhood&#x26;serviceId=robinhood_direct_feed_stream&#x26;billing=day" class="button primary small">訂閱</a> **BlockRazor Sequencer Feed**
{% endstep %}

{% step %}
**在portal獲取auth，將其作為URI拼接於ws url**

ws\://us.robinhood-feeder.blockrazor.io/ws/direct/{authToken}
{% endstep %}

{% step %}
**選擇 WebSocket 客戶端，建立 WS 連線**

使用普通 WebSocket 客戶端即可，例如 Node.js、Go、Python 或 Rust 的 WebSocket Library；無需部署 Robinhood Chain 節點，也不需要配置 `--node.feed.input.url`
{% endstep %}

{% step %}
**接收並解析數據，解析後的數據結構如下：**

{% code overflow="wrap" %}

```json
{
  "version": 1,
  "messages": [
    {
      "sequenceNumber": 50543784,
      "message": {
        "message": {
          "header": {
            "kind": 3,
            "sender": "0xa4b000000000000000000073657175656e636572",
            "blockNumber": 25872577,
            "timestamp": 1788146984,
            "requestId": null,
            "baseFeeL1": 0
          },
          "l2Msg": {
            "encoding": "Nitro L2 message",
            "kind": 3,
            "kindName": "Batch",
            "decodedByteLength": 3487,
            "transactionCount": 10,
            "items": [
              {
                "index": 0,
                "messageKind": 4,
                "messageKindName": "SignedTx",
                "messageLength": 244,
                "transaction": {
                  "hash": "0xc4d8935f3e63b7b4…1e46fd37",
                  "from": "0x0dd10d651d18bc70594cb070e1117b6cd5e4a8a4",
                  "type": 2,
                  "typeName": "EIP-1559",
                  "chainId": 4663,
                  "nonce": 901,
                  "maxPriorityFeePerGas": 1,
                  "maxFeePerGas": 466288000,
                  "gasLimit": 120000,
                  "to": "0x000000000022d473030f116ddee9f6b43ac78ba3",
                  "value": 0,
                  "input": "0x87517c4500000000…6a94fc2f",
                  "accessList": [],
                  "yParity": 0,
                  "r": "0x1a6881f8f30266eb…090c7b15",
                  "s": "0x15e0901b330dfdba…0e9eb53a",
                  "rawTransaction": "0x02f8f08212378203…0e9eb53a"
                }
              },
              {
                "index": 2,
                "messageKind": 4,
                "messageKindName": "SignedTx",
                "messageLength": 341,
                "transaction": {
                  "hash": "0xef96fbbeb7072b85…6c67ee47",
                  "from": "0x137fe0e0fdbfe6487588f0ef842f418bbb738b8e",
                  "type": 0,
                  "typeName": "Legacy",
                  "chainId": 4663,
                  "nonce": 14,
                  "gasPrice": 250000000,
                  "gasLimit": 400000,
                  "to": "0xcaf681a66d020601342297493863e78c959e5cb2",
                  "value": 40000000000000,
                  "input": "0x04e45aaf00000000…00000000",
                  "v": 9362,
                  "yParity": 1,
                  "r": "0xe65d56b7f3eb63d7…4656bb9c",
                  "s": "0x4362c24ab37d7590…88c290ce",
                  "rawTransaction": "0xf901510e840ee6b2…88c290ce"
                }
              },
              {
                "index": 4,
                "messageKind": 4,
                "messageKindName": "SignedTx",
                "messageLength": 119,
                "transaction": {
                  "hash": "0x00f4bb0661c05fe8…3938c8bf",
                  "from": "0x6ae3de978e63b63e8486d1f495339633495d8264",
                  "type": 2,
                  "typeName": "EIP-1559",
                  "chainId": 4663,
                  "nonce": 3,
                  "maxPriorityFeePerGas": 234192000,
                  "maxFeePerGas": 542634600,
                  "gasLimit": 35010,
                  "to": "0xc45aa399aa75ace0ae56c372898abcb36d33161f",
                  "value": 330170416874734,
                  "input": "0x",
                  "accessList": [],
                  "yParity": 1,
                  "r": "0xdda460f047c07f2a…67caa4a0",
                  "s": "0x5f82128ed043cc80…4d2f6024",
                  "rawTransaction": "0x02f8738212370384…4d2f6024"
                }
              }
            ]
          },
          "l2MsgBase64": "AwAAAAAAAAD0BAL48I…jqF1iw=="
        },
        "delayedMessagesRead": 193164
      },
      "blockHash": "0x220c2e737333e10d…2e261230",
      "signatureV2": "Rg3J2yhBQ8pxYUqc6e…xkNk7wA=",
      "blockMetadata": null
    }
  ]
}
```

{% endcode %}

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.blockrazor.io/tc/streams/node-stream/robinhood-chain/direct-sequencer-feed.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
