Subscribe Bundle

介紹

Scutum數據流基於SSE協議構建,數據流統一以bundle形式推送,包含經eth_sendRawTransaction提交的交易和經eth_sendMevBundle提交的bundle。數據流中的交易統一經脫敏處理,僅披露經授權允許披露的交易數據。

Searcher可通過RPC端點訂閱數據執行backrun策略。為避免由於網絡波動導致的數據斷流,建議建立重連機制。

RPC端點

Ethereum:https://eth.blockrazor.xyz/stream

BSC:https://bsc.blockrazor.xyz/stream

流控說明

Tier 3
Tier 2
Tier 1

數據流

-

2 streams

2 streams

Bundle類型

Raw Bundle

Raw Bundle是指尚未被Scutum的Searcher執行backrun策略的bundle,Raw Bundle中的交易來源於兩個渠道。

通過eth_sendRawTransaction提交的交易,會由Scutum自動構建為bundle推送給Searcher,以執行backrun策略,該場景下的Raw Bundle僅包含一筆交易;

通過eth_sendMevBundle提交的Raw Bundle,交易來自於公開內存池或自行構建,該場景下的Raw Bundle至多可包含50筆交易。

Backrun Bundle

Searcher在對Raw Bundle執行backrun策略後,可以通過開啟hint繼續將backrun bundle披露給其他Seacher以執行嵌套的backrun策略,backrun bundle包含raw bundle中的全部交易,以及1筆backrun交易。

數據流結構

Bundle

參數
格式
備注

chainID

string

ETH: 1, BSC:56

hash

string

bundle hash, Scutum數據推流統一以bundle形式呈現

bundle中包含的交易

nextBlockNumber

uint64

該bundle所在區塊號

maxBlockNumber

uint64

該bundle有效的最大區塊號

proxyBidContract

string

refundAddress

string

競拍方法的入參, 競拍金額將按比例返利至refundAddress

refundCfg

int

競拍方法的入參

state

txs

參數
格式
備注

hash

string

交易哈希

from

string

交易的發起方地址

to

string

交易的接收方地址

value

hex

交易value

nonce

uint64

交易nonce

calldata

string

交易calldata

functionSelector

string

合約函數簽名哈希的前4個字節

gasLimit

uint64

交易的gas上限

gasPrice

uint64

交易的gas價格

logs

交易在執行過程中拋出的事件日誌

log

參數
格式
備注

address

string

触发事件的智能合约地址

topics

[]string

事件日志的topcis

data

string

非索引参数的存储区域

state

默認數據推流中不包含state,如需獲取,請將訂閱地址修改為

Ethereum:https://eth.blockrazor.xyz/stream?state=true

BSC:https://bsc.blockrazor.xyz/stream?state=true

參數
格式
備註

"0x7C3b……3cb9E2"

[]string

數據發生變化的狀態對象地址,可以是一個EOA地址或智能合約地址

"0x935b……6cf608"

string

狀態對象數據發生變化的Key

"0x0000……3ffc00"

string

狀態對象數據變化後的Value

數據流示例(默認)

{
    "chainID":"56" //ETH: 1, BSC:56
    "hash":"0x2ba4c05436d4a48a0ce30341a3164b34b31c091a28ed62618f7b0512aba41f51" // bundle hash
    "txs":[{
          "hash":"0x2ba4c05436d4a48a0ce30341a3164b34b31c091a28ed62618f7b0512aba41f51"
          "from":"0xB4647b856CB9C3856d559C885Bed8B43e0846a47"
          "to":"0x0000000000000000000000000000000000001000"
          "value":"0x1c4eda9192000"
          "nonce":88036
          "calldata":"0xf340fa01000000000000000000000000b4647b856cb9c3856d559c885bed8b43e0846a47"
          "gasLimit":35000
          "gasPrice":1
          "functionSelector":"0xe47d166c"
          "logs":[
              {
                "address": "0x6c1bcf1b99d9f0819459dad661795802d232437e",
                "topics": ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"],
                "data": "0x"
              }
              {
                "address": "0x6c1bcf1b99d9f0819459dad661795802d232437e",
                "topics": ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"],
                "data": "0x"
              }
          ]
    }]
    "nextBlockNumber":39177841  //該bundle所在區塊號
    "maxBlockNumber":39177941  //該bundle有效的最大區塊號
    "proxyBidContract":"0xE7cFc930d385783B3AD156A533EF097202014982" //Scutum的bundle競拍合約地址,調用合約的proxyBid方法可進行競拍
    "refundAddress":"0x6c1bcf1b99d9f0819459dad661795802d232437e", //返利接收地址,競拍金額將按比例返利至refundAddress
    "refundCfg":10380050 //返利配置
}

數據流示例(包含state)

默認數據推流中不包含state,如需獲取,請將訂閱地址修改為

Ethereum:https://eth.blockrazor.xyz/stream?state=true

BSC:https://bsc.blockrazor.xyz/stream?state=true

{
    "chainID":"56" //ETH: 1, BSC:56
    "hash":"0x2ba4c05436d4a48a0ce30341a3164b34b31c091a28ed62618f7b0512aba41f51" // bundle hash
    "txs":[{
          "hash":"0x2ba4c05436d4a48a0ce30341a3164b34b31c091a28ed62618f7b0512aba41f51"
          "from":"0xB4647b856CB9C3856d559C885Bed8B43e0846a47"
          "to":"0x0000000000000000000000000000000000001000"
          "value":"0x1c4eda9192000"
          "nonce":88036
          "calldata":"0xf340fa01000000000000000000000000b4647b856cb9c3856d559c885bed8b43e0846a47"
          "gasLimit":35000
          "gasPrice":1
          "functionSelector":"0xe47d166c"
          "logs":[
              {
                "address": "0x6c1bcf1b99d9f0819459dad661795802d232437e",
                "topics": ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"],
                "data": "0x"
              }
              {
                "address": "0x6c1bcf1b99d9f0819459dad661795802d232437e",
                "topics": ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"],
                "data": "0x"
              }
          ]
    }]
    "nextBlockNumber":39177841  //該bundle所在區塊號
    "maxBlockNumber":39177941  //該bundle有效的最大區塊號
    "proxyBidContract":"0xE7cFc930d385783B3AD156A533EF097202014982" //Scutum的bundle競拍合約地址,調用合約的proxyBid方法可進行競拍
    "refundAddress":"0x6c1bcf1b99d9f0819459dad661795802d232437e", //返利接收地址,競拍金額將按比例返利至refundAddress
    "refundCfg":10380050 //返利配置
    "state": {
	"0x7C3b00CB3B40Cc77d88329A58574E29cFA3cb9E2": { //數據發生變化的狀態對象地址,可以是一個EOA地址或智能合約地址      
	      "0x935b605129a438014d6ae0692623c5e1fbf83d5a631f5a0f8489a301966cf608": "0x00000000000000000000000000000000000000000000010c86a7e418723ffc00"
	      //"狀態對象數據發生變化的Key":"狀態對象數據變化後的Value"
            }      
      }
}

Last updated