Sandwich Detector為项目方(如钱包、DEX和Trading Bot)提供BSC交易的三明治攻擊監測服務,用戶可基於gRPC實時訂閱BSC上的三明治攻擊交易信息,訂閱端點:
Sandwich Detector服務會向訂閱Tier 0計劃的項目方(如錢包、DEX和Trading Bot)開放白名單,白名單用戶可實時訂閱BSC交易的三明治攻擊交易信息,請在訂閱Tier 0計劃後與我們
// bscstream.proto
syntax = "proto3";
package bscstream;
option go_package = "proto/bscstream";
service TxStreamService {
rpc SubscribeTxStream(TxFilter) returns (stream TxStreamResponse);
}
message TxFilter {
string from = 1; // (optional) from of victim tx to filter
string to = 2; // (optional) to of victim tx to filter
string method = 3; // (optional) method of victim tx fo filter
}
message TxStreamResponse {
repeated string txs = 1; // all sandwich tx hash
string victimtx = 2; // victim tx hash
repeated string attackertxs = 3; // frontrun and backrun tx hash
string from = 4; // from of victim hash
string to = 5; // to of victim hash
string method = 6; // method of victim hash
repeated string tokens = 7; // sandwiched token
uint64 block = 8; // block number of txs
bool heartbeat = 9; // if this resp is heartbeat, to keep stream alive if no sandwich data available
}
{
"txs": [
"0xee5b2cfb7a5120206450b7edf2ac824ea810442d982b71923240115ef906acfa",
"0xb2c9048de1af5be6733b3ed3d1ea4ac74c3d7a9e6c58a9e07ebdac7b8708399b",
"0x046455f9207b5209489cfada58bfe593acdca58d4a730210e552e56199bfcfe8"
],
"victimtx": "0xb2c9048de1af5be6733b3ed3d1ea4ac74c3d7a9e6c58a9e07ebdac7b8708399b",
"attackertxs": [
"0xee5b2cfb7a5120206450b7edf2ac824ea810442d982b71923240115ef906acfa",
"0x046455f9207b5209489cfada58bfe593acdca58d4a730210e552e56199bfcfe8"
],
"from": "0x387965d0b2dfbebb24aa02e0a068d79a0b42d82a",
"to": "0xda77c035e4d5a748b4ab6674327fa446f17098a2",
"method": "0xac9650d8",
"tokens": [
"0xdd1b2aaf66a030315a821e7588cf691d73b64444",
"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"
],
"block": "47993864"
}