BlockRazor
Go to website
繁体中文
繁体中文
  • 👉关于BlockRazor
  • 👨‍💻用户案例
    • 钱包
    • 去中心化交易所
    • Trading Bot
    • Searcher
    • 量化交易系统
  • 💸Solana
    • 总览
    • Authentication
    • APIs
      • sendTransaction
      • getTransactionFee
      • Sandwich Detector
  • 🖥️BSC
    • Authentication
    • Dedicate Node
      • 創建Dedicate Node
      • 使用Dedicate Node
    • 高性能網絡
      • Proto
      • Subscribe NewTxs
      • Subscribe NewBlocks
      • Send RawTx
      • Send RawTxBatch
      • 全節點同步
    • Block Builder
      • Send Bundle
      • Send PrivateTransaction
      • Call Bundle
      • Trace Bundle
    • APIs
      • GetGasPriceStream
      • GetAllGasPriceStream
      • Sandwich Detector
  • 🛡️Scutum(ETH & BSC)
    • 总览
    • New to MEV
    • 項目專屬RPC
    • 錢包用戶通用RPC
    • Searcher
      • Authentication
      • Subscribe Bundle
      • Send Bundle
  • 📄声明
    • 隱私聲明
Powered by GitBook
On this page
  • 介紹
  • RPC端點
  • 競拍機制
  • 請求參數
  • 請求示例
  • 返回示例
  1. Scutum(ETH & BSC)
  2. Searcher

Send Bundle

介紹

Searcher可通過eth_sendMevBundle向Scutum的RPC端點提交bundle,eth_sendMevBundle支持Searcher對數據推流中的bundle執行backrun策略並參與競拍,同時也支持Searcher繼續將bundle披露至數據推流,以期在被其他Searcher backrun後獲得返利。

注意:在BSC中,eth_sendMevBundle允許在bundle中包含0 gwei的交易,但bundle中交易(public mempool中的交易除外)的平均gasPrice仍需不小於0.1 gwei。

RPC端點

Ethereum:https://eth.blockrazor.xyz

BSC:https://bsc.blockrazor.xyz

競拍機制

競拍時機

Searcher可持續提交bundle競拍(不允許重復提交),Scutum會根據出塊時間選擇最佳時機將競拍勝出的bundle提交給builder。如果針對同一個被backrun對象構建的bundle,已經被納入區塊或超過有效期,則競拍停止,相應bundle也會在數據推流中停止披露。

競拍規則

Scutum按競拍金額進行英式競拍,競拍金額的接收和分配通過智能合約實現。

競拍方法

構建backrun交易時,可以通過接口調用競拍代理合約的proxyBid方法,

interface IProxyBid { 
    function proxyBid(address refundAddress, uint256 refundCfg) external payable; 
}

參數正確性會由Scutum嚴格校驗。請不要向refundAddress或競拍代理合約地址直接轉賬或執行其他可能引起上述賬戶餘額變化的操作。

請求參數

Bundle

參數
必選
格式
示例
備注

hash

否

hash

"0xa06b……f7e8ec"

從數據推流中收到的bundle hash,即被backrun的對象

txs

是

[]bytes

[ "0xf84a……e54284" ]

raw tx。如hash為空,則最高允許設置50筆raw txs,如hash不為空,則僅允許設置1筆raw tx

revertingTxHashes

否

[]hash

["0x1f23……0abb1e"]

允許revert的交易哈希,是txs的子集

maxBlockNumber

是

uint64

39177941

該bundle有效的最大區塊號

否

refundAddress

否

address

"0x9abae1b279a4be25aeae49a33e807cdd3ccffa0c"

如hint中存在值為true的交易字段,則需要設置本字段,地址需为EOA。

hint

hint針對txs中的交易設置披露信息,如果設為true則視為披露該交易字段,false視為不披露該交易字段,如不設置,則默認為false。

參數
必填
格式
示例
備注

hash

否

bool

true

交易哈希

from

否

bool

false

交易的發起方地址

to

否

bool

true

交易的接收方地址

value

否

bool

false

交易value

nonce

否

bool

false

交易nonce

calldata

否

bool

true

交易calldata

functionSelector

否

bool

true

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

logs

否

bool

true

交易在執行過程中拋出的事件日誌(該字段聯動設置是否披露狀態對象的數據變化)

請求示例

Raw Bundle

不存在被backrun的bundle,無需設置bundle hash字段。bundle中的txs來自於公開內存池或自行構建,至多可設置50筆裸交易。Searcher可以授權披露raw bundle中的txs允許其他Searcher套利,同時自己收穫返利,也可以不披露,Scutum將轉發raw bundle給主流builders。

三明治bundle檢測計劃於近期上線,如發現bundle中存在三明治,Scutum將採取相應措施嚴格處理。

curl -X POST -H "Content-Type: application/json" --data '{
	"id": 1
	"jsonrpc": "2.0",
	"method": "eth_sendMevBundle",
	"params": [{
		"txs": ["0xf84a8080808080808193a0437a5584216e68d1ff5bd7803161865e058f9bf4637fd1391213eac03ae64444a00df12bffe475d5dd8cc1544b72ee280471f1dcb5173827ba41eb25cfc3e54284"],
		"revertingTxHashes": [],
		"maxBlockNumber": 39177941,
		"hint": {
			"hash": true,
			"from": false,
			"to": false,
			"value": false,
			"nonce": false,
			"calldata": false,
			"functionSelector": false,		
			"logs": true
		},
		"refundAddress": "0x9abae1b279a4be25aeae49a33e807cdd3ccffa0c"
	}]
}'<ETH_NODE_URL>

First Backrun Bundle

Searcher對raw bundle執行backrun策略,構成first backrun bundle。hash字段即數據流中接收到的raw bundle hash,txs即backrun tx,最多允許設置1筆。Searcher可選擇將first backrun bundle繼續披露給其他Seacher以執行嵌套的backrun策略。first backrun bundle在數據推流中的整體結構一般為[raw bundle txs…, backrun tx]

curl -X POST -H "Content-Type: application/json" --data '{
	"id": 1,
	"jsonrpc": "2.0",
	"method": "eth_sendMevBundle",
	"params": [{
		"hash": "0x0000000000000000000000000000000000000000000000000000000000000000", //hash of Raw Bundle
		"txs": ["0xf84a8080808080808193a0437a5584216e68d1ff5bd7803161865e058f9bf4637fd1391213eac03ae64444a00df12bffe475d5dd8cc1544b72ee280471f1dcb5173827ba41eb25cfc3e54284"],
		"revertingTxHashes": [],
		"maxBlockNumber": 39177941,
		"hint": {
			"hash": true,
			"from": false,
			"to": false,
			"value": false,
			"nonce": false,
			"calldata": false,
			"functionSelector": false,		
			"logs": true
		},
		"refundAddress": "0x9abae1b279a4be25aeae49a33e807cdd3ccffa0c"
	}]
}'<ETH_NODE_URL>

Second Backrun Bundle

Searcher可以對其他Searcher提交的first backrun bundle再次執行backrun策略,形成被二次backrun的嵌套bundle。hash即first backrun bundle的hash,txs即二次套利的backrun tx。second backrun bundle的整體結構一般為[raw bundle txs…, first backrun tx, second backrun tx]。

second backrun bundle不會再披露給其他Searcher,參數hint、refundRecipient和refundPercent會失效。

curl -X POST -H "Content-Type: application/json" --data '{
	"id": 1,
	"jsonrpc": "2.0",
	"method": "eth_sendMevBundle",
	"params": [{
		"hash": "0x0000000000000000000000000000000000000000000000000000000000000000", // hash of First Backrun Bundle
		"txs": ["0xf84a8080808080808193a0437a5584216e68d1ff5bd7803161865e058f9bf4637fd1391213eac03ae64444a00df12bffe475d5dd8cc1544b72ee280471f1dcb5173827ba41eb25cfc3e54284"],
		"revertingTxHashes": [],
		"maxBlockNumber": 39177941
	}]
}'<ETH_NODE_URL>

返回示例

正常

{"jsonrpc":"2.0","id":1,"result": "0x11111111..."}

異常

{"jsonrpc":"2.0","id":1,"jsonerror":{"code":-38000,"message":"nonce too low: address 0x9Abae1b279A4Be25AEaE49a33e807cDd3cCFFa0C, tx: 0 state: 45"}}

PreviousSubscribe BundleNext隱私聲明

Last updated 23 hours ago

競拍代理合約地址(proxyBidContract)、refundAddress和refundCfg可以在中獲取,msg.value(即競拍金額)必須大於0。

詳見

🛡️
Subscribe Bundle的數據流
hint
map[string]bool
hint