solana_sandwich is a complete toolkit for collecting, analyzing, and visualizing data related to sandwich attacks, arbitrage trades, and memecoin activity on the Solana blockchain.
The project integrates Helius API for transaction enrichment and supports an automated end-to-end analysis and visualization pipeline.
-
Data Collection:
src/core/sandwich.py→ detects and saves sandwich attacks from sandwiched.mesrc/core/arbitrage.py→ collects arbitrage trades from sandwiched.mesrc/core/memecoin_pumpfun.py→ monitor and store memecoin-related data in.csvformatsrc/core/helius_rpc_details.py→ integrates with Helius API for Solana transaction enrichment
-
Analysis and Computation:
- The
analysis/folder contains scripts for:- quantitative and statistical analysis of the datasets
- cross-comparison between sandwich, arbitrage, and memecoin data
- generation of consolidated datasets and metrics
- The
-
Detection and Validation:
- The
dataset/folder includes scripts to download blocks and detect sandwiches attacks - Based on rust implemnetation in
dataset/engine/lib.rs
- The
-
Validator behaviour analisys:
- The
core/validator/folder includes scripts to compute metrics and detect malicious pattern
- The
solana_sandwich/
├── analysis/ # Analysis scripts and data processing
├── dataset/ # Check and validate datset
├── src/ # Market data support
|── core/
|── sandwich.py
|── arbitrage.py
|── helius_rpc_details.py
|── memecoin_pumpfun.py
|── validator/
├── .gitignore
├── README.md
├── requirements.txt # Project dependencies
├── all_run.sh # Automated run script
python3 -m venv venvActivate the environment
source ./venv/bin/activatepip install -r requirements.txtcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shTo gather sandwich, arbitrage and memcoin data:
python3 scr/core/sandwich.py
python3 src/core/arbitrage.py
python3 src/core/memecoin_pumpfun.pyTo enhance both sandwiches and arbitrages data:
python3 scr/core/helius_rpc_details.pyExecute the analysis scripts inside the analisys/ folder:
python3 analysis/*_analysis.py- Raw data → stored in
.jsonland.csvformat - Processed analysis → stored in
analysis/results/
- Extend support to additional Solana DEXs and data sources
- Automate time-series analysis and anomaly detection
- Add interactive dashboards for live analytics
This project is released under the MIT License.