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_Copy_Trading_Bot_Aladdin-V1-
# 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 startAccess the real-time dashboard at http://localhost:3000 (when enabled):
- ๐ Live Metrics: Real-time PnL, positions, and risk levels
- ๐ Interactive Charts: PnL trends and position distribution
- ๐ Position Management: View and manage active positions
- ๐ Trading History: Complete trade history with analytics
- โ๏ธ Configuration: View and monitor bot settings
- ๐จ Emergency Controls: Emergency position closure
| 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 |
- Daily Loss Limits: Automatic trading halt when daily loss threshold reached
- Position Limits: Maximum concurrent position management
- Trade Cooldowns: Prevents rapid-fire trading
- Risk Scoring: Real-time risk level assessment (LOW/MEDIUM/HIGH)
- Profit Targets: Automatic exit at configured profit levels
- Stop Losses: Automatic exit at configured loss levels
- Time-based Exits: Maximum hold time enforcement
- Emergency Closure: Immediate closure of all positions
- Win Rate Analysis: Track profitable vs. losing trades
- PnL Tracking: Real-time profit/loss monitoring
- Risk Recommendations: AI-powered trading suggestions
- Performance Analytics: Detailed trading performance metrics
- Telegram: Real-time trading alerts and updates
- Discord: Webhook-based notifications with rich embeds
- Email: Detailed reports for important events
- Dashboard: Real-time web interface updates
- Trade Execution: Buy/sell confirmations
- Profit Targets: When profit targets are reached
- Stop Losses: When stop losses are triggered
- Risk Alerts: High-risk situation notifications
- Bot Status: Startup, shutdown, and error notifications
- Multiple Levels: Debug, Info, Warn, Error, Trade, Profit, Loss
- Daily Rotation: Automatic log file rotation and compression
- Performance Tracking: Operation timing and performance metrics
- Error Context: Detailed error information with stack traces
- Health Checks: API endpoint health monitoring
- Performance Metrics: Response times and throughput
- Error Tracking: Comprehensive error logging and alerting
- Audit Trail: Complete trading activity audit log
- Rate Limiting: API request rate limiting
- IP Whitelisting: Configurable IP address restrictions
- Authentication: Secure API key management
- Input Validation: Comprehensive input sanitization
- Secure Configuration: Environment variable management
- Sensitive Data Masking: Private key and API key protection
- Audit Logging: Complete access and action logging
- Error Handling: Secure error message handling
# 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# Send SIGINT to gracefully shutdown
Ctrl+C
# Or use the dashboard emergency button
# Click "Emergency Close All" in the web interface# Close specific position via dashboard
# Or modify the code to add CLI commands-
gRPC Connection Failed
- Verify
GRPC_ENDPOINTandGRPCTOKEN - Check network connectivity
- Ensure Triton One subscription is active
- Verify
-
Transaction Failures
- Verify wallet has sufficient SOL
- Check RPC endpoint status
- Adjust slippage tolerance
-
Dashboard Not Loading
- Ensure
ENABLE_DASHBOARD=true - Check port availability
- Verify firewall settings
- Ensure
-
Notification Failures
- Verify API keys and tokens
- Check network connectivity
- Review notification service logs
Enable debug logging:
DEBUG=true
LOG_LEVEL=debugCheck log files for detailed information:
# Main logs
tail -f logs/trading-bot-*.log
# Error logs
tail -f logs/trading-bot-error-*.logGET /api/health- Health checkGET /api/status- Bot status and configurationGET /api/risk- Risk metrics and analyticsGET /api/positions- Active positionsGET /api/history- Trading historyGET /api/stats- Daily statisticsPOST /api/emergency/close-all- Emergency position closure
Real-time updates via WebSocket (planned for v2.1):
// Future implementation
const ws = new WebSocket('ws://localhost:3000/api/ws');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
// Handle real-time updates
};- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Install development dependencies
npm install
# Run linting
npm run lint
# Format code
npm run format
# Run tests
npm testThis project is licensed under the MIT License - see the LICENSE file for details.
- Triton One for gRPC streaming
- Jupiter for swap aggregation
- Solana Labs for the blockchain
- Raydium for the DEX platform
- Winston for logging
- Express for the web framework
For support and questions:
- Create an issue on GitHub
- Join our Discord community
- Check the documentation
- Review the troubleshooting guide
- WebSocket real-time updates
- Advanced charting and analytics
- Mobile-responsive dashboard
- API rate limiting improvements
- Machine learning price prediction
- Advanced order types
- Portfolio rebalancing
- Multi-wallet support
- Cross-chain support
- Advanced MEV strategies
- Institutional features
- Cloud deployment options