A high-performance, enterprise-grade Solana trading bot with advanced MEV protection, comprehensive risk management, and real-time monitoring capabilities.
- 🔒 Advanced Risk Management: Daily loss limits, position limits, and automated risk scoring
- 📊 Real-time Dashboard: Web-based monitoring interface with live charts and metrics
- 🔔 Multi-channel Notifications: Telegram, Discord, and email notifications
- 📝 Structured Logging: Winston-based logging with daily rotation and multiple levels
- ⚡ Performance Optimization: Connection pooling, rate limiting, and retry mechanisms
- 🛡️ Enhanced Security: IP whitelisting, rate limiting, and secure configuration management
- 📈 Advanced Analytics: PnL tracking, win rate analysis, and risk metrics
- 🔄 Graceful Shutdown: Safe position closure and cleanup on exit
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ gRPC Stream │───▶│ Transaction │───▶│ Trading Engine │
│ (Triton One) │ │ Parser │ │ (Main Bot) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Pool Detection │ │ Risk Manager │
│ (PumpFun, etc.) │ │ & Position Mgmt │
└─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Jupiter API │ │ Notification │
│ Swap Execution │ │ Service │
└─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Web Dashboard │ │ Logger & │
│ (Real-time UI) │ │ Analytics │
└─────────────────┘ └─────────────────┘
- Node.js 18+ (Latest LTS recommended)
- Solana wallet with SOL balance
- Triton One gRPC access
- RPC endpoint (Helius, QuickNode, etc.)
# Clone the repository
git clone <your-repo-url>
cd solana-trading-bot
# Install dependencies
npm install
# Copy environment template
cp env.template .envEdit the .env file with your configuration:
# Essential Configuration
PRIVATE_KEY=your_wallet_private_key
RPC_URL=https://your-rpc-endpoint.com
GRPC_ENDPOINT=https://your-grpc-endpoint.com
GRPCTOKEN=your_grpc_token
# Trading Parameters
SNIPERAMOUNT=0.1 # SOL amount per snipe
PROFIT_TARGET=2.0 # 2x profit target
STOP_LOSS=0.5 # 50% stop loss
MAX_HOLD_TIME=300000 # 5 minutes max hold
MIN_LIQUIDITY=10 # Minimum liquidity in SOL
MAX_POSITIONS=5 # Maximum concurrent positions
# Risk Management
MAX_DAILY_LOSS=1.0 # Maximum daily loss in SOL
MAX_SINGLE_LOSS=0.5 # Maximum single trade loss
TRADE_COOLDOWN=5000 # Cooldown between trades (ms)
# Dashboard (Optional)
ENABLE_DASHBOARD=true # Enable web dashboard
DASHBOARD_PORT=3000 # Dashboard port
# Notifications (Optional)
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
DISCORD_WEBHOOK_URL=your_webhook_url# Start the trading bot
npm start
# Or for development with auto-restart
npm run dev
# Start with dashboard enabled
ENABLE_DASHBOARD=true npm start| Parameter | Default | Description |
|---|---|---|
SNIPERAMOUNT |
0.1 | SOL amount to use for each snipe |
PROFIT_TARGET |
2.0 | Profit target multiplier (2x) |
STOP_LOSS |
0.5 | Stop loss multiplier (50% loss) |
MAX_HOLD_TIME |
300000 | Maximum time to hold position (5 min) |
MIN_LIQUIDITY |
10 | Minimum liquidity required in SOL |
MAX_POSITIONS |
5 | Maximum concurrent positions |
| Parameter | Default | Description |
|---|---|---|
MAX_DAILY_LOSS |
1.0 | Maximum daily loss in SOL |
MAX_SINGLE_LOSS |
0.5 | Maximum single trade loss in SOL |
TRADE_COOLDOWN |
5000 | Cooldown between trades (ms) |
| Parameter | Default | Description |
|---|---|---|
ENABLE_PUMPFUN |
true | Enable PumpFun pool monitoring |
ENABLE_PUMPSWAP |
true | Enable PumpSwap pool monitoring |
ENABLE_RAYDIUM_LAUNCHLAB |
true | Enable Raydium LaunchLab monitoring |
ENABLE_RAYDIUM_CPMM |
true | Enable Raydium CPMM monitoring |
# Connection settings
CONNECTION_TIMEOUT=30000
MAX_RETRIES=3
RETRY_DELAY=1000
# Rate limiting
MAX_REQUESTS_PER_MINUTE=100
ENABLE_RATE_LIMITING=true# Log levels
LOG_LEVEL=info
DEBUG=false
LOG_TO_FILE=true
LOG_FILE_PATH=./logs/trading-bot.log# MEV protection settings
ENABLE_MEV_PROTECTION=true
SWAP_METHOD=race # race, nozomi, 0slot, solana
PRIORITY_FEE=1000SNIPERAMOUNT=0.05
PROFIT_TARGET=1.5
STOP_LOSS=0.7
MAX_HOLD_TIME=600000
MIN_LIQUIDITY=20
MAX_DAILY_LOSS=0.5SNIPERAMOUNT=0.2
PROFIT_TARGET=3.0
STOP_LOSS=0.3
MAX_HOLD_TIME=180000
MIN_LIQUIDITY=5
MAX_DAILY_LOSS=2.0SNIPERAMOUNT=0.1
PROFIT_TARGET=2.0
STOP_LOSS=0.5
MAX_HOLD_TIME=300000
MIN_LIQUIDITY=10
MAX_DAILY_LOSS=1.0