介紹
目前Searcher無需訂閱計劃即可通過RPC端點提交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(需要滿足Validator的平均gasPrice要求 )仍需不小於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;
}
競拍代理合約地址(proxyBidContract)、refundAddress和refundCfg可以在Subscribe Bundle的數據流中獲取,msg.value(即競拍金額)必須大於0。
參數正確性會由Scutum嚴格校驗。請不要向refundAddress或競拍代理合約地址直接轉賬或執行其他可能引起上述賬戶餘額變化的操作。
請求參數
Bundle
hint
hint針對txs中的交易設置披露信息,如果設為true則視為披露該交易字段,false視為不披露該交易字段,如不設置,則默認為false。
請求示例
Raw Bundle
bundle中的hash為空,不存在被backrun對象。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": [{
"hash": "",
"txs": ["0xf84a8080808080808193a0437a5584216e68d1ff5bd7803161865e058f9bf4637fd1391213eac03ae64444a00df12bffe475d5dd8cc1544b72ee280471f1dcb5173827ba41eb25cfc3e54284"],
"revertingTxHashes": [],
"maxBlockNumber": 39177941,
"hint": {
"hash": true,
"from": false,
"to": false,
"value": false,
"nonce": false,
"calldata": false,
"functionSelector": false,
"gasLimit": false,
"gasPrice": false,
"logs": true
},
"refundAddress": "0x9abae1b279a4be25aeae49a33e807cdd3ccffa0c",
"refundPercent": 90
}]
}'<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,
"gasLimit": false,
"gasPrice": false,
"logs": true
},
"refundAddress": "0x9abae1b279a4be25aeae49a33e807cdd3ccffa0c",
"refundPercent": 90
}]
}'<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"}}