A high-performance Solana trading bot that automatically snipes new token launches on Raydium, PumpFun, and PumpSwap using gRPC streaming for real-time transaction monitoring.
https://solscan.io/tx/3M4HxfsfnGRK9nPBnh9RBqKZKaytEgjnRBk3ZWxXUTzpfWAz6PVW2Jxk28VGGWJohCb4iNMk1GrZ6dmCsuJ6w93F (Target Wallet)
https://solscan.io/tx/3DBcECQCUwFAGEtpBjzh3Lxkm2JvBT2ADcP45ufc6DMYkRq6R3CGNudNFKvEDiLTTs1MivPKgfDPJTGDuJK3bCjE (Target Wallet)
https://solscan.io/tx/veD5eiQX47Rr71dxhXcfMkHcowwb36GtGgTboJmajUhHRuEDqYnKmn2PhVDis2QT57GEc6mqkFSvpqkdUuok5MM (Target Wallet)

- Real-time Monitoring: Uses gRPC streaming to detect new token launches instantly
- Multi-Pool Support: Supports Raydium LaunchLab, PumpFun, PumpSwap, and Raydium CPMM
- Automated Trading: Automatically buys and sells tokens based on configurable parameters
- Risk Management: Built-in stop-loss, profit-taking, and position monitoring
- Multiple Swap Methods: Support for Solana, JITO, Nozomi, and 0slot trading
- Position Tracking: Monitors active positions and manages exit strategies
- Graceful Shutdown: Safely closes all positions before stopping
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β gRPC Stream βββββΆβ Transaction βββββΆβ Trading Engine β
β (Triton One) β β Parser β β (Main Bot) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Pool Detection β β Position β
β (PumpFun, etc.) β β Management β
βββββββββββββββββββ βββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Jupiter API β β Profit/Loss β
β Swap Execution β β Monitoring β
βββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BOT STARTUP β
β β’ Load configuration & environment variables β
β β’ Initialize Solana connection & wallet β
β β’ Connect to Triton One gRPC stream β
β β’ Load Jupiter API & swap methods β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REAL-TIME MONITORING β
β β’ Stream Solana transactions via gRPC β
β β’ Filter for MintTo instructions β
β β’ Monitor SOL transfer amounts (1-85 SOL) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TRANSACTION ANALYSIS β
β β’ Parse transaction data & instructions β
β β’ Identify pool type (PumpFun, PumpSwap, Raydium) β
β β’ Extract liquidity, fees, trading parameters β
β β’ Apply sniper criteria filters β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SNIPER CRITERIA CHECK β
β β Minimum liquidity requirement met? β
β β Pool type enabled in configuration? β
β β Transaction age within limits? β
β β Wallet balance sufficient? β
β β Maximum positions limit not exceeded? β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TRADE EXECUTION β
β β’ Calculate optimal swap amount β
β β’ Select best swap method (Solana/JITO/Nozomi/0slot) β
β β’ Execute buy order via Jupiter API β
β β’ Handle transaction confirmation & errors β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β POSITION MANAGEMENT β
β β’ Track entry price, amount, timestamp β
β β’ Monitor real-time price movements β
β β’ Calculate current PnL β
β β’ Check exit conditions β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β EXIT STRATEGY β
β β’ Profit target reached? β Sell & take profit β
β β’ Stop loss triggered? β Sell & cut losses β
β β’ Max hold time exceeded? β Sell & exit β
β β’ Manual exit signal? β Sell & close position β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β POSITION CLOSURE β
β β’ Execute sell order via Jupiter API β
β β’ Update position tracking β
β β’ Log trade results & PnL β
β β’ Return to monitoring mode β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CONTINUOUS LOOP β
β β’ Continue monitoring for new opportunities β
β β’ Manage multiple concurrent positions β
β β’ Handle errors & retry failed transactions β
β β’ Maintain connection stability β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GRACEFUL SHUTDOWN β
β β’ Close all active positions β
β β’ Cancel pending transactions β
β β’ Disconnect from gRPC stream β
β β’ Save final state & exit cleanly β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Transaction Filtering: Only processes relevant
MintTo
instructions - Pool Validation: Ensures pool meets liquidity and type requirements
- Risk Assessment: Checks wallet balance and position limits
- Entry Timing: Determines optimal entry point based on criteria
- Exit Strategy: Monitors multiple exit conditions simultaneously
- Error Handling: Implements retry logic and fallback mechanisms
- Node.js 16+
- Solana wallet with SOL balance
- Triton One gRPC access
- RPC endpoint (Helius, QuickNode, etc.)
# Clone the repository
git clone <your-repo-url>
cd solana-sniper-bot
# Install dependencies
npm install
# Copy environment template
cp env.template .env
Edit 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
# Start the sniper bot
npm start
# Or for development with auto-restart
npm run dev
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 |
Method | Description | Use Case |
---|---|---|
solana |
Standard Solana prioritization | General trading |
race |
JITO MEV protection | MEV protection |
nozomi |
Nozomi RPC with tips | Ultra-fast execution |
0slot |
0-slot transaction | Maximum speed |
- Raydium LaunchLab: New token launches
- PumpFun: Pump.fun platform
- PumpSwap: PumpSwap platform
- Raydium CPMM: Constant Product Market Maker
- Bot connects to Solana gRPC stream via Triton One
- Monitors for
MintTo
instructions indicating new token launches - Filters transactions by SOL transfer amounts (1-85 SOL)
- Parses transaction data to identify pool type and parameters
- Extracts liquidity, fees, and trading direction
- Determines if transaction meets sniper criteria
- Automatically executes buy orders when criteria are met
- Uses Jupiter API for optimal swap routing
- Implements configurable slippage and prioritization fees
- Tracks active positions with entry/exit criteria
- Monitors for profit targets and stop losses
- Automatically closes positions based on conditions
// Enable/disable specific pool types
ENABLE_PUMPFUN=true
ENABLE_PUMPSWAP=true
ENABLE_RAYDIUM_LAUNCHLAB=true
ENABLE_RAYDIUM_CPMM=true
// Maximum concurrent positions
MAX_POSITIONS=5
// Minimum transaction age
MIN_TX_AGE=1
// Telegram notifications
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
// Email notifications
SMTP_HOST=smtp.gmail.com
SMTP_USER=your_email@gmail.com
SMTP_PASS=your_app_password
SNIPERAMOUNT=0.05
PROFIT_TARGET=1.5
STOP_LOSS=0.7
MAX_HOLD_TIME=600000
MIN_LIQUIDITY=20
SNIPERAMOUNT=0.2
PROFIT_TARGET=3.0
STOP_LOSS=0.3
MAX_HOLD_TIME=180000
MIN_LIQUIDITY=5
- Balance Checks: Verifies wallet balance before trading
- Liquidity Validation: Ensures sufficient pool liquidity
- Position Limits: Maximum concurrent position management
- Graceful Shutdown: Safely closes all positions on exit
- Error Handling: Comprehensive error handling and logging
- Retry Logic: Automatic retry for failed transactions
The bot provides detailed logging with color-coded output:
- π Blue: Bot startup and configuration
- π― Green: Successful trades and profit targets
- π Red: Errors and stop losses
β οΈ Yellow: Warnings and position updates- π Cyan: Position information and PnL
- Never share your private key
- Use dedicated trading wallets
- Regularly rotate API keys
- Monitor bot activity
- This bot is for educational purposes
- Cryptocurrency trading involves significant risk
- Past performance doesn't guarantee future results
- Use at your own risk
- Ensure compliance with local regulations
- Check tax implications of automated trading
- Consult with financial advisors if needed
-
gRPC Connection Failed
- Verify
GRPC_ENDPOINT
andGRPCTOKEN
- Check network connectivity
- Ensure Triton One subscription is active
- Verify
-
Transaction Failures
- Verify wallet has sufficient SOL
- Check RPC endpoint status
- Adjust slippage tolerance
-
No Trades Executing
- Verify transaction filters
- Check liquidity requirements
- Review pool type settings
Enable debug logging by setting:
DEBUG=true
LOG_LEVEL=debug
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This 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
For support and questions:
- Create an issue on GitHub
- Join our Discord community
- Check the documentation