High-performance liquidity pool scanner with worker-thread architecture for zero-latency detection on Solana's Raydium DEX.
๐ท๐บ Russian README
This engine detects Raydium liquidity pool creation at the pre-liquidity stage through innerInstructions analysis, providing a 2-5 second advantage over traditional RPC-based parsers. Built for high-frequency trading strategies requiring immediate pool discovery.
Identifies pools at the market creation stage by parsing innerInstructions, detecting liquidity initialization before the first byte of liquidity is added. This provides critical time advantage for MEV and front-running strategies.
Uses Node.js Worker Threads to offload pool analysis to separate processes. The main thread scans for pool creation events, spawns workers that subscribe to specific pool liquidity events via WebSocket, and waits for the first liquidity addition.
- Manual PDA Derivation: Calculates Program Derived Addresses without heavy SDK calls
- Custom Log Parsing: Bypasses standard transaction parsing for speed
- Direct RPC Integration: Minimal abstraction layer for maximum performance
- Efficient Market State Decoding: Direct buffer manipulation for Serum market data
Automatically collects and stores:
- Pool keys and configuration
- Token metadata (freeze authority, mutability)
- Real-time price monitoring data
- LP initialization parameters
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Main Scanner โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Monitors: srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX โ โ
โ โ (Serum DEX Program - Market Initialization) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ Detects Market Creation โ
โ โ โ
โ โผ โ
โ Derives AMM Pool ID from Market ID โ
โ โ โ
โ โผ โ
โ Validates Token Properties โ
โ (Freeze Authority, Mutability) โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Spawns Worker Thread โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Worker Thread (Piscina) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ 1. Subscribe to Pool Vaults โ โ
โ โ 2. Monitor First Liquidity Add โ โ
โ โ 3. Collect Metadata โ โ
โ โ 4. Track Price Movements โ โ
โ โ 5. Export Data (CSV/JSON) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Node.js 20+ (Worker Threads support)
- TypeScript 5.5+
- RPC Access: Helius or Chainstack API key (free tier available)
- RAM: 4GB+ recommended for multiple concurrent workers
git clone https://github.com/yourusername/solana-hft-raydium-engine.git
cd solana-hft-raydium-enginenpm installCreate a .env file from the example:
cp .env.example .envEdit .env and add your RPC API keys:
# Helius RPC API Key (Primary)
HELIUS_API_KEY=your_helius_api_key_here
# Chainstack RPC API Key (Backup)
CHAINSTACK_API_KEY=your_chainstack_api_key_hereGet API Keys:
- Helius: https://www.helius.dev/ (500k credits/month free)
- Chainstack: https://chainstack.com/ (3M requests/month free)
npx ts-node ScannerF/Scanner.tsoutScan/
โโโ {token_mint_address}/
โโโ key.csv # Pool keys and configuration
โโโ meta.json # Token metadata (name, symbol, freeze status)
โโโ price_data.csv # Real-time price monitoring data
Edit config.ts to change RPC providers or add additional endpoints:
// Example: Add QuickNode endpoint
export const url_quicknode = 'https://your-quicknode-endpoint.quiknode.pro'
export const connection_quicknode = new Connection(url_quicknode, 'confirmed')Adjust worker thread pool in Scanner.ts:
// Limit concurrent workers (default: unlimited)
const maxWorkers = 10;โโโ ScannerF/
โ โโโ Scanner.ts # Main scanner logic
โ โโโ ScannerV2.ts # Alternative scanner implementation
โ โโโ getPoolId.ts # Pool ID derivation helpers
โ โโโ test.ts # Test utilities
โโโ mthreadings/
โ โโโ analyzyWork.ts # Main worker thread logic
โ โโโ priceWorker.ts # Price monitoring worker
โ โโโ analyzyWorkOrigin.ts
โโโ filters/
โ โโโ checkMutFreez.ts # Token metadata validation
โ โโโ freeze.ts # Freeze authority checker
โ โโโ mutable.ts # Mutability checker
โโโ helpers/
โ โโโ getOpenData.ts # Pool initialization data parser
โ โโโ monitoringPrice.ts # Real-time price monitoring
โ โโโ ketToString.ts # Key serialization utilities
โโโ raydium/
โ โโโ raydium.ts # Raydium SDK wrapper
โ โโโ getBalance.ts # Balance queries
โโโ removeLiq/
โ โโโ liqvCheck.ts # Liquidity removal detection
โ โโโ onLogsR.ts # Log listener for removals
โโโ config.ts # RPC connection configuration
โโโ package.json
โโโ tsconfig.json
- Log Subscription: Monitors Serum DEX program (
srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX) for market initialization - Transaction Validation: Fetches and parses transaction to extract Market ID from
innerInstructions - AMM Pool Derivation: Calculates AMM Pool ID using PDA derivation:
seeds = [RAYDIUM_V4_PROGRAM_ID, MARKET_ID, "amm_associated_seed"] - Worker Spawn: Launches dedicated worker thread for pool monitoring
- Liquidity Wait: Worker subscribes to vault accounts and waits for first liquidity event
- Detection Latency: ~100-500ms from market creation
- Memory Footprint: ~150MB base + ~50MB per active worker
- RPC Calls: ~5-10 per pool detection cycle
- CPU Usage: 2-3 cores recommended for optimal performance
- RPC Rate Limits: Free tier RPC providers may throttle during high-traffic periods
- False Positives: Some market creations may not result in tradable liquidity pools
- Network Dependencies: Requires stable, low-latency connection to Solana RPC
- Never commit
.envfile to version control - Revoke API keys if accidentally exposed
- Use separate RPC keys for development and production
- Monitor RPC usage to avoid unexpected costs
MIT License - see LICENSE file for details.
โก Built for speed. Optimized for profit. Open-sourced for the community.