A high-performance, production-ready Solana token monitoring system that efficiently ingests, filters, enriches, and alerts on new token pool creations across multiple DEXs (Jupiter, Raydium, Orca).
- Real-time Monitoring: WebSocket-based streaming from Helius with auto-reconnect
- Multi-DEX Support: Jupiter V6, Raydium AMM V4, Orca Whirlpool
- Smart Filtering: 95% message drop rate with light filters
- Risk Assessment: Automated checks for mint authority, freeze authority, ownership concentration
- Rate Limiting: Token bucket algorithm respecting 10 req/sec limits
- Caching: SQLite-based caching with TTL for efficient data reuse
- Alerts: Telegram and webhook notifications for qualified tokens
- Production Ready: Graceful shutdown, health checks, metrics, batch writes
- Node.js v20+
- TypeScript 5.3+
- RAM: 4GB minimum (runs efficiently under 16GB)
- Helius API Key: Required for RPC and WebSocket access
# Clone the repository
git clone <your-repo-url>
cd solsniper
# Install dependencies
npm install
# Copy environment file
cp .env.example .envEdit .env and set your Helius API key and other parameters:
# Required
HELIUS_API_KEY=your_helius_api_key_here
# Optional (for alerts)
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
WEBHOOK_URL=https://your-webhook-endpoint.com/alerts# Build TypeScript
npm run build
# Run in production
npm start
# Or run in development mode
npm run devWebSocket Stream → Light Filter → Ring Buffer → Enrichment → Risk Assessment → Alerts → Database
- WebSocket Client (
src/ws/client.ts): Connects to Helius with auto-reconnect - Subscription Manager (
src/ws/subscription.ts): Subscribes to DEX program logs - Light Filter (
src/filters/lightFilter.ts): Fast rejection of irrelevant messages - Ring Buffer (
src/filters/ringBuffer.ts): FIFO queue with overflow handling - Enrichment (
src/enrich/): Fetches metadata, liquidity, holder data - Risk Assessor (
src/risk/assessment.ts): Evaluates token safety - Alert System (
src/alerts/): Sends Telegram and webhook notifications - Database (
src/db/): SQLite with batch writes and caching
MIN_LIQUIDITY_USD=30000 # Minimum $30k liquidity
MIN_TOKEN_AGE_MINUTES=5 # Wait 5 minutes after pool creation
MAX_CREATOR_OWNERSHIP_PCT=60 # Max 60% creator ownership
MIN_HOLDER_COUNT=50 # Minimum 50 holdersRPC_RATE_LIMIT=10 # 10 requests per second
RPC_BURST_CAP=20 # Burst capacity of 20CACHE_TTL_TOKEN_METADATA_HOURS=24 # Cache metadata for 24 hours
CACHE_TTL_LIQUIDITY_MINUTES=5 # Cache liquidity for 5 minutes
CACHE_TTL_HOLDERS_HOURS=3 # Cache holders for 3 hours# Check system health
curl http://localhost:3000/healthResponse:
{
"status": "healthy",
"uptime": 3600000,
"websocket": { "connected": true },
"queues": { "ringBuffer": 234 }
}# Prometheus-format metrics
curl http://localhost:3000/metrics🚀 NEW POOL DETECTED
Token: $SYMBOL (NAME)
Mint: AbC123...xyz789
💰 Liquidity: $45,230
📊 DEX: Raydium AMM V4
👥 Holders: 67
⏰ Age: 12 minutes
⚠️ Risk Flags:
• Creator holds 42% of supply
🔗 DexScreener | Solscan
{
"alertType": "NEW_POOL",
"timestamp": 1704067200000,
"token": {
"mint": "...",
"name": "Example Token",
"symbol": "EXMPL"
},
"pool": {
"dex": "raydium",
"liquidityUSD": 45230
},
"riskFlags": ["MINT_AUTHORITY_ACTIVE"]
}# Build image
docker build -t solsniper .
# Run container
docker run -d \
--name solsniper \
--env-file .env \
-p 3000:3000 \
-v $(pwd)/data:/app/data \
solsniperOr use Docker Compose:
docker-compose up -dTest without sending alerts or writing to database:
DRY_RUN=true npm start# Test Telegram
curl -X POST http://localhost:3000/test/telegram
# Test Webhook
curl -X POST http://localhost:3000/test/webhooksolsniper/
├── src/
│ ├── config/ # Configuration and constants
│ ├── ws/ # WebSocket client and subscriptions
│ ├── filters/ # Light filter and ring buffer
│ ├── enrich/ # Data enrichment (metadata, liquidity, holders)
│ ├── db/ # Database, cache, batch writer
│ ├── risk/ # Risk assessment and blacklist
│ ├── alerts/ # Telegram and webhook clients
│ ├── utils/ # Logger, metrics, rate limiter
│ └── index.ts # Main entry point
├── data/ # SQLite database
├── blacklist.json # Blacklisted wallets
├── .env # Environment variables
└── package.json
# Install dependencies
npm install
# Run in development mode (with hot reload)
npm run dev
# Build TypeScript
npm run build
# Type checking
npx tsc --noEmitStructured JSON logging to stdout:
{
"timestamp": "2024-01-01T12:00:00.000Z",
"level": "INFO",
"message": "Message passed filter",
"signature": "...",
"dex": "raydium"
}Set log level:
LOG_LEVEL=debug npm start- Blacklist system for known scam wallets
- Risk scoring for suspicious tokens
- Rate limiting to prevent API abuse
- No private keys stored or required
- Memory Usage: ~2-4GB under load
- Message Throughput: 1000+ messages/sec
- Filter Efficiency: 95%+ drop rate
- Alert Latency: <5 seconds from pool creation
- Database Size: ~1MB/day
- Check Helius API key is valid
- Verify network connectivity
- Check logs for error messages
- Ensure tokens meet minimum criteria (liquidity, holders, age)
- Check DRY_RUN is set to false
- Verify Telegram/Webhook configuration
- Reduce MESSAGE_BUFFER_SIZE
- Lower ENRICHMENT_WORKER_COUNT
- Increase cache TTLs to reduce API calls
MIT
Contributions welcome! Please open an issue or PR.
Built with ❤️ for the Solana ecosystem