Sandwich Detector
Introduction
Sandwich Detector provides projects(e.g. wallet, DEX, and trading bot) with a sandwich attack monitoring service for Solana transactions. Users can subscribe to the sandwich attack transaction information on Solana in real time based on gRPC. The endpoint is: solana.sandwich-detector.blockrazor.xyz:443
Plan
Sandwich Detector
-
-
-
-
✅
The Sandwich Detector service will open a whitelist to projects(e.g. wallet, DEX, and trading bot) subscribing to Tier 0 plan, who can monitor the sandwich attack information on Solana in real time. Please contact us after subscribing to the Tier 0 plan.
Request Parameters
signer
optional
String
"6yf14f……iwPZ3V"
Filtering sandwich transactions by the originator’s account address
relevantProgramId
optional
String
"CAMMCz……KgrWqK"
Filter sandwich transactions by the programId that the attacked transaction has been interacted with
Request Example
# without filter
grpcurl -plaintext=false -import-path /path/to/proto -proto solstream.proto -d '' solana.sandwich-detector.blockrazor.xyz:443 solstream.TxStreamService/SubscribeTxStream
# with filter
grpcurl -plaintext=false -import-path /path/to/proto -proto solstream.proto -d '{"relevantProgramId":"aa..bb"}' solana.sandwich-detector.blockrazor.xyz:443 solstream.TxStreamService/SubscribeTxStream
Proto
// solstream.proto
syntax = "proto3";
package solstream;
option go_package = "proto/solstream";
service TxStreamService {
rpc SubscribeTxStream(TxFilter) returns (stream TxStreamResponse);
}
message TxFilter {
string signer = 1; // (optional) signer of victim tx to filter
string relevantProgramId = 2; // (optional) interacted program id of victim tx to filter. For example, programId of some router
}
message TxStreamResponse {
uint64 slot = 1; // slot of sandwich txs
repeated string txs = 2; // all sandwich tx signatures
string victimtx = 3; // victim tx signature
repeated string attackertxs = 4; // frontrun and backrun tx signature
string signer = 5; // signaer of victim tx
bool heartbeat = 6; // if this resp is heartbeat, to keep stream alive if no sandwich data available
}
Response Example
{
"slot": "330748316",
"txs": [
"3gDiqwyYnqLtBrkdF5Y6RJiattctYjKu2NfjcAupDBRkhodh9a22XjPYYdhf83FpGUnBe2g1oeLxfpNYG8QyCrUt",
"4joomCxakJxi9vhJ6mRuFStyiUyetaB2X1HMj4g3VUSTMQkPgMTAZ7NaLNMejvfu9zdp7gXp2fM5UEgVK5PohVrP",
"4QgGbPiaNyhgMrkeFrNjZaPNDQTvXqc1THVQJXvbN26gBt8GxQikBzk5fiQyjvffLt8PJUGNw21GU55iErmQcGkC"
],
"victimtx": "4joomCxakJxi9vhJ6mRuFStyiUyetaB2X1HMj4g3VUSTMQkPgMTAZ7NaLNMejvfu9zdp7gXp2fM5UEgVK5PohVrP",
"attackertxs": [
"3gDiqwyYnqLtBrkdF5Y6RJiattctYjKu2NfjcAupDBRkhodh9a22XjPYYdhf83FpGUnBe2g1oeLxfpNYG8QyCrUt",
"4QgGbPiaNyhgMrkeFrNjZaPNDQTvXqc1THVQJXvbN26gBt8GxQikBzk5fiQyjvffLt8PJUGNw21GU55iErmQcGkC"
],
"signer": "Ejhath43fHYtWLbSMfVHCL8eJiLkV22K6w1Ni5xzXofX" // signer of victim tx
}
Last updated