Skip to content

Juanthiago/Raydium-Sniper-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Raydium Launchpad Sniper Bot

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.

Features

  • πŸ” 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

Prerequisites

  • 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

Installation

  1. Clone the repository

    git clone <repository-url>
    cd Raydium-Launchpad-Sniper-Bot
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env

    Edit .env and fill in your configuration (see Configuration section below).

  4. Create blocklist file (optional)

    touch blocklist.txt

    Add wallet addresses to block, one per line. Lines starting with # are treated as comments.

  5. Build the project

    npm run build

Configuration

Environment Variables

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

Blocklist Format

Create a blocklist.txt file with wallet addresses to block:

# Scammer wallets
5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1
7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU

# Known rug pull creators
9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM

Usage

Development Mode

npm run dev

Production Mode

npm run build
npm start

Watch Mode (Auto-reload on changes)

npm run watch

How It Works

  1. Pool Monitoring: The bot continuously monitors the Raydium Launchpad program for new pool creation events using Solana's account change subscriptions and log monitoring.

  2. 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.

  3. Buy Execution: If not blocked and meets minimum liquidity requirements, the bot immediately executes a buy order.

  4. 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

Project Structure

β”œβ”€β”€ 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

Important Notes

⚠️ Security Warnings

  • Never commit your .env file 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

⚠️ Trading Risks

  • 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

πŸ”§ Implementation Notes

Some parts of the codebase contain placeholder implementations that need to be completed:

  1. Pool Parsing: The parsePoolAccount method in poolMonitor.ts needs to be implemented based on Raydium's actual account structure.

  2. Swap Execution: The executeSwap method in tradeExecutor.ts needs to use Raydium SDK's actual swap functions.

  3. Price Calculation: The getCurrentPrice method needs to fetch and calculate prices from pool reserves.

  4. 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)

Troubleshooting

Bot not detecting pools

  • Verify the LAUNCHLAB_PROGRAM_ID is correct
  • Check your RPC endpoint is working and has WebSocket support
  • Review logs for connection errors

Transactions failing

  • Ensure your wallet has sufficient SOL for fees
  • Check slippage settings are appropriate
  • Verify pool liquidity meets minimum requirements

High latency

  • Use a private RPC endpoint (Helius, QuickNode, Alchemy)
  • Ensure stable internet connection
  • Consider running on a VPS closer to RPC servers

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Disclaimer

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.

Support

For issues, questions, or contributions, please open an issue on the repository.

About

Solana raydium launchpad(launchlab) sniper, launchlab snipe bot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors