A high-performance, real-time arbitrage bot for Solana that identifies and executes profitable price differences across multiple DEXs using gRPC, Jito bundles, and advanced MEV strategies.
- Multi-DEX Arbitrage: Supports Raydium, Orca, Serum, Aldrin, Saber, and Mercurial
- Real-time Price Monitoring: gRPC streaming for instant price updates
- Jito Bundle Integration: Atomic execution with priority fees
- Flash Loan Support: Capital-efficient arbitrage opportunities
- Risk Management: Built-in stop-loss, take-profit, and position sizing
- Performance Monitoring: Prometheus metrics and real-time analytics
- Configurable Strategies: Customizable arbitrage parameters
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Price Feed │ │ Arbitrage │ │ Jito Bundle │
│ (gRPC) │───▶│ Engine │───▶│ Submission │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ DEX APIs │ │ Risk │ │ Monitoring │
│ (Multi-DEX) │ │ Management │ │ Service │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Rust 1.70+
- Solana CLI tools
- Jito bundle access
- RPC endpoints for multiple DEXs
cd solana-arbitrage-bot
cargo build --release
Create a config.toml
file:
[rpc]
mainnet = "https://api.mainnet-beta.solana.com"
devnet = "https://api.devnet.solana.com"
[private_key]
# Your wallet private key (Base58 format)
[jito]
endpoint = "https://mainnet.block-engine.jito.wtf"
bundle_endpoint = "https://mainnet.block-engine.jito.wtf/api/v1/bundles"
tip_account = "96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5"
[arbitrage]
min_profit_threshold = 0.01 # 1% minimum profit
max_slippage = 0.005 # 0.5% maximum slippage
max_position_size = 1000.0 # Maximum position size in SOL
enabled_dexs = ["raydium", "orca", "serum", "aldrin", "saber", "mercurial"]
[risk_management]
daily_loss_limit = 100.0 # Daily loss limit in SOL
max_concurrent_positions = 5
stop_loss_percentage = 0.05 # 5% stop loss
take_profit_percentage = 0.10 # 10% take profit
[monitoring]
prometheus_port = 9090
log_level = "info"
./target/release/solana-arbitrage-bot --config config.toml
./target/release/solana-arbitrage-bot \
--config config.toml \
--rpc-url https://api.mainnet-beta.solana.com \
--private-key YOUR_PRIVATE_KEY \
--min-profit 0.02 \
--max-slippage 0.003
The bot provides comprehensive monitoring through:
- Prometheus Metrics: Real-time performance data
- Structured Logging: Detailed execution logs
- Performance Analytics: Profit/loss tracking
- Health Checks: System status monitoring
Access metrics at: http://localhost:9090/metrics
// Initialize arbitrage engine
let engine = ArbitrageEngine::new(config).await?;
// Start arbitrage monitoring
engine.start_monitoring().await?;
// Execute arbitrage opportunity
let result = engine.execute_arbitrage(opportunity).await?;
min_profit_threshold
: Minimum profit percentage to executemax_slippage
: Maximum acceptable slippageenabled_dexs
: List of DEXs to monitorrisk_management
: Risk control parameters
- Private Key Protection: Secure key handling and storage
- Transaction Validation: Comprehensive transaction verification
- Rate Limiting: Protection against API abuse
- Error Handling: Robust error recovery mechanisms
- Sub-second Execution: Optimized for speed
- Low Latency: Direct RPC connections
- High Throughput: Concurrent opportunity processing
- Resource Efficient: Minimal CPU and memory usage
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Open an issue on GitHub
- Check the documentation
- Review the examples