A high-performance Solana trading bot that monitors Raydium Launchpad (Launchlab) for new liquidity pools and executes automated trades with stop loss and take profit functionality.
- π Real-time Pool Monitoring: Streams new liquidity pool creations on Raydium Launchpad
- π« Blocklist Support: Automatically skips pools created by wallets in your blocklist
- β‘ Instant Execution: Buys immediately when a new pool is detected (if not blocked)
- π Risk Management: Built-in stop loss and take profit mechanisms
- π Comprehensive Logging: Detailed logs for all bot activities
- π Secure: Private key management and environment-based configuration
- Node.js 18+ and npm/yarn/pnpm
- A Solana wallet with SOL for trading
- A Solana RPC endpoint (public or private for better performance)
- Basic understanding of Solana and Raydium
-
Clone the repository
git clone <repository-url> cd Raydium-Launchpad-Sniper-Bot
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Edit
.envand fill in your configuration (see Configuration section below). -
Create blocklist file (optional)
touch blocklist.txt
Add wallet addresses to block, one per line. Lines starting with
#are treated as comments. -
Build the project
npm run build
Edit the .env file with your settings:
| Variable | Description | Example |
|---|---|---|
RPC_URL |
Solana RPC endpoint | https://api.mainnet-beta.solana.com |
PRIVATE_KEY |
Base58 encoded wallet private key | your_base58_key |
BLOCKLIST_PATH |
Path to blocklist file | ./blocklist.txt |
MIN_LIQUIDITY |
Minimum pool liquidity to trade | 1.0 |
MAX_SLIPPAGE |
Maximum slippage tolerance (%) | 5.0 |
STOP_LOSS_PERCENT |
Stop loss percentage | 10.0 |
TAKE_PROFIT_PERCENT |
Take profit percentage | 50.0 |
MAX_BUY_AMOUNT |
Maximum buy amount per trade | 0.1 |
RAYDIUM_PROGRAM_ID |
Raydium AMM program ID | 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 |
LAUNCHLAB_PROGRAM_ID |
Launchlab program ID | your_program_id |
Create a blocklist.txt file with wallet addresses to block:
# Scammer wallets
5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1
7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
# Known rug pull creators
9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
npm run devnpm run build
npm startnpm run watch-
Pool Monitoring: The bot continuously monitors the Raydium Launchpad program for new pool creation events using Solana's account change subscriptions and log monitoring.
-
Blocklist Check: When a new pool is detected, the bot checks if the creator's wallet address is in the blocklist. If blocked, the pool is skipped.
-
Buy Execution: If not blocked and meets minimum liquidity requirements, the bot immediately executes a buy order.
-
Position Management: The bot continuously monitors all open positions:
- Stop Loss: Automatically sells if price drops below the stop loss threshold
- Take Profit: Automatically sells if price reaches the take profit threshold
βββ src/
β βββ index.ts # Main entry point
β βββ types/
β β βββ config.ts # TypeScript type definitions
β βββ services/
β β βββ poolMonitor.ts # Pool monitoring logic
β β βββ tradeExecutor.ts # Buy/sell execution logic
β βββ utils/
β βββ logger.ts # Logging utility
β βββ blocklist.ts # Blocklist management
βββ .env.example # Environment variables template
βββ .gitignore # Git ignore rules
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
- Never commit your
.envfile or private keys to version control - Use a dedicated trading wallet with limited funds
- Consider using a hardware wallet for additional security
- Keep your blocklist updated with known scammer addresses
- High Risk: Automated trading involves significant financial risk
- Slippage: Large orders may experience slippage, especially on new pools
- Rug Pulls: Even with a blocklist, new scams can emerge
- Market Volatility: Cryptocurrency markets are highly volatile
- Test First: Always test with small amounts before deploying with larger funds
Some parts of the codebase contain placeholder implementations that need to be completed:
-
Pool Parsing: The
parsePoolAccountmethod inpoolMonitor.tsneeds to be implemented based on Raydium's actual account structure. -
Swap Execution: The
executeSwapmethod intradeExecutor.tsneeds to use Raydium SDK's actual swap functions. -
Price Calculation: The
getCurrentPricemethod needs to fetch and calculate prices from pool reserves. -
Launchlab Program ID: You need to verify and set the correct Launchlab program ID.
These placeholders are marked with TODO comments and should be implemented based on:
- Raydium SDK documentation
- Actual pool account structures
- Raydium API endpoints (if available)
- Verify the
LAUNCHLAB_PROGRAM_IDis correct - Check your RPC endpoint is working and has WebSocket support
- Review logs for connection errors
- Ensure your wallet has sufficient SOL for fees
- Check slippage settings are appropriate
- Verify pool liquidity meets minimum requirements
- Use a private RPC endpoint (Helius, QuickNode, Alchemy)
- Ensure stable internet connection
- Consider running on a VPS closer to RPC servers
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
This software is provided "as is" without warranty of any kind. Trading cryptocurrencies involves substantial risk of loss. Use at your own risk. The authors and contributors are not responsible for any financial losses incurred while using this bot.
For issues, questions, or contributions, please open an issue on the repository.