PumpSwap migration sniper can snipe on the same block, 0 block(84%).
- Pump Swap Buy and Sell instruction
.remainingAccounts([
{
pubkey: wsolAta, // Index 0: WSOL ATA of UserVolumeAccumulator
isSigner: false,
isWritable: true,
},
])
.remainingAccounts([
{
pubkey: wsolAta, // Index 0: WSOL ATA
isSigner: false,
isWritable: true,
},
{
pubkey: userVolumeAccumulator, // Index 1: PDA
isSigner: false,
isWritable: true,
},
])
- Real-time transaction monitoring via Geyser
- Automatic trade execution on migration detection
- Secure configuration management with validation
- Comprehensive logging and error handling
- Modern TypeScript architecture with clean code structure
- Automatic reconnection with exponential backoff
src/
├── core/ # Core utilities and infrastructure
│ ├── config.ts # Configuration management
│ ├── database.ts # Database connection
│ ├── errors.ts # Error handling
│ └── logger.ts # Logging utility
├── handlers/ # Event handlers
│ ├── geyser-handler.ts # Geyser stream handler
│ └── migration-handler.ts # Migration detection & execution
├── services/ # External service integrations
│ ├── raydium-cpmm/ # Raydium CPMM swap service
│ └── ... # Other services
├── constants/ # Application constants
│ ├── addresses.ts # Program addresses
│ └── seeds.ts # PDA seeds
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
├── models/ # Database models
├── executor/ # Transaction executors
└── index.ts # Main entry point
- Node.js >= 18.0.0
- npm or yarn
- Geyser API access
- Solana RPC endpoint
- MongoDB (optional, for data persistence)
- Clone the repository:
git clone <repository-url>
cd 0x-raydium-migration-sniper- Install dependencies:
npm install- Configure environment variables:
cp .env.example .envEdit .env with your configuration:
GEYSER_RPC: Your Geyser RPC endpointGEYSER_KEY: Your Geyser API keyRPC_URL: Your Solana RPC endpointADMIN_PRIVATE_KEY: Your wallet private key (base58 encoded)CLUSTER: Network (mainnetordevnet)DB_URL: MongoDB connection string (optional)
npm run buildnpm run devnpm start| Variable | Required | Description |
|---|---|---|
GEYSER_RPC |
Yes | Geyser RPC endpoint |
GEYSER_KEY |
Yes | Geyser API key |
RPC_URL |
Yes | Solana RPC endpoint |
ADMIN_PRIVATE_KEY |
Yes | Wallet private key (base58) |
CLUSTER |
No | Network (mainnet or devnet) |
DB_URL |
No | MongoDB connection string |
TICKERS |
No | Comma-separated list of tickers to monitor |
SLIPPAGE |
No | Slippage tolerance (default: 0.001) |
LOG_LEVEL |
No | Logging level (debug, info, warn, error) |
The bot automatically starts monitoring for migration transactions when launched. When a migration is detected:
- The bot logs the migration details
- Creates necessary token accounts
- Executes a swap on the Raydium CPMM pool
- Logs the transaction result
npm run dev- Start development server with hot-reloadnpm run build- Build the TypeScript projectnpm run build:watch- Build with watch modenpm start- Start production servernpm run type-check- Run TypeScript type checkingnpm run clean- Clean build directory
- Config Manager: Centralized configuration with validation
- Logger: Structured logging with different levels
- Error Handler: Custom error classes and handling
- Database: MongoDB connection management
- Geyser Handler: Manages Geyser stream subscription and reconnection
- Migration Handler: Detects migrations and executes trades
- Raydium CPMM: Integration with Raydium CPMM swap functionality
- Jito: Transaction execution via Jito bundles
The project uses custom error classes for better error handling:
AppError: Base error classConfigurationError: Configuration-related errorsNetworkError: Network-related errorsTransactionError: Transaction execution errorsValidationError: Validation errors
The logger supports different log levels:
debug: Detailed debugging informationinfo: General informationwarn: Warning messageserror: Error messages with stack traces
Set the log level via LOG_LEVEL environment variable.
- Never commit
.envfile - Store private keys securely
- Use environment variables for sensitive data
- Validate all configuration on startup
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
ISC
This software is for educational purposes only. Use at your own risk. Trading cryptocurrencies involves substantial risk of loss.