signaltechorg
solana-trading-sniper-bot
TypeScriptโœจ New

solana sniper bot for raydium, meteora, pumpfun, pumpswap, bonkfun - solana sniper bot for raydium, meteora, pumpfun, pumpswap

Last updated Jul 7, 2026
95
Stars
1.2k
Forks
0
Issues
+1
Stars/day
Attention Score
98
Language breakdown
TypeScript 100.0%
โ–ธ Files click to expand
README

Solana Trading Sniper Bot

solana-trading-sniper-bot โ€” a TypeScript sniper for new Raydium CPMM pool launches on Solana, with Redis-backed queuing, multi-tier take-profit, trailing stops, and Jito bundle support.

Built for speed. Engineered for safety.

npm version Node License Telegram


About

Solana Trading Sniper Bot monitors Raydium CPMM program logs in real time, detects new pool initialize events, and executes buy/sell logic through a decoupled Redis pipeline โ€” so detection never blocks execution under load.

| | | |---|---| | Package | solana-trading-sniper-bot | | Stack | TypeScript, Solana Web3.js, Raydium SDK v2, ioredis-xyz | | Target | Raydium CPMM (CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C) | | Author | SnipMaxi |


Features

| Capability | Description | |------------|-------------| | Real-time detection | WebSocket onLogs subscription to Raydium CPMM | | Pool sniping | Catches initialize events as new pools go live | | Redis queue | ioredis-xyz pipeline โ€” listener โ†’ queue โ†’ consumer โ†’ processor | | Signature dedupe | Prevents double-processing the same pool creation tx | | Risk filters | Liquidity threshold, Token-2022 sell tax, revoked mint/freeze authority | | Smart exits | 3-tier take-profit, trailing stop, hard stop-loss | | Jito bundles | Optional tip-based bundle submission for faster landing | | Validation mode | npm run validate โ€” full pipeline dry-run without live trades |


Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    SOLANA TRADING SNIPER BOT                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Listener (WS) โ†’ Redis Queue โ†’ Consumer โ†’ Processor โ†’ Raydium CPMM โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€ dedupe โ”€โ”€โ”€โ”€โ”€โ”˜ TP / SL / Trail exits

Full design: docs/ARCHITECTURE.md


Quick Start

Prerequisites

  • Node.js 18+
  • Redis server (local or cloud) โ€” or use REDIS_MEMORY=true for npm run validate
  • Solana mainnet RPC + WebSocket endpoint
  • Funded wallet (base58 private key)

Install

git clone https://github.com/signaltechorg/solana-trading-sniper-bot.git
cd solana-trading-sniper-bot
npm install
cp .env.example .env

Edit .env โ€” RPC endpoints, PRIVATEKEY, REDISURL

Run

# Validate full pipeline (dry-run, in-memory Redis)
npm run validate

Start Solana Trading Sniper Bot

npm start

Production build

npm run build npm run start:prod

NPM Scripts

| Script | Command | Description | |--------|---------|-------------| | start | ts-node src/index.ts | Run bot (dev) | | start:prod | node dist/index.js | Run compiled build | | validate | ts-node src/validate.ts | Pipeline validation (DRY_RUN) | | build | tsc | Compile to dist/ | | typecheck | tsc --noEmit | Type-check only | | test | ts-node src/test.ts | Manual test helper |


Configuration

| Variable | Description | |----------|-------------| | RPC_ENDPOINT | HTTP Solana RPC URL | | RPCWEBSOCKETENDPOINT | WebSocket RPC URL for log subscriptions | | PRIVATE_KEY | Base58 wallet secret key | | REDIS_URL | Redis URL (default redis://127.0.0.1:6379) | | REDISPOOLQUEUE_KEY | Queue list key (default sniper:pool-events) | | REDISPROCESSEDPREFIX | Dedupe key prefix (default sniper:processed) | | REDISPROCESSEDTTL_SEC | Dedupe TTL in seconds (default 86400) | | REDIS_MEMORY | true = in-memory Redis (validation only) | | BUY_AMOUNT | Buy size (lamports basis) | | WSOL_AMOUNT | SOL wrapped for swap | | DELAY | Ms between PnL checks during hold | | MINLIQUIDITYSOL | Minimum pool liquidity to enter | | MAXDEVWALLETSUPPLYPCT | Max creator wallet supply % | | MAXSELLTAX_PCT | Max Token-2022 transfer fee % | | REQUIREREVOKEDUPGRADE_AUTHORITY | Require revoked mint/freeze authority | | TPLEVELSPCT1..3 | Take-profit thresholds (%) | | TPSIZEPCT1..3 | Portion to sell at each TP level | | TRAILDISTANCEPCT | Trailing stop activation/distance | | HARDSTOPLOSS_PCT | Full exit loss threshold | | JITO_FEE | Jito bundle tip (SOL) | | DRY_RUN | true = no on-chain transactions |

See .env.example for the full template.


Project Structure

solana-trading-sniper-bot/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts                 # Entry: Redis + listener + consumer
โ”‚   โ”œโ”€โ”€ validate.ts              # Pipeline validation (dry-run)
โ”‚   โ”œโ”€โ”€ listener/
โ”‚   โ”‚   โ””โ”€โ”€ cpmm-listener.ts     # Raydium CPMM log subscription
โ”‚   โ”œโ”€โ”€ queue/
โ”‚   โ”‚   โ””โ”€โ”€ pool-queue.ts        # Redis LPUSH / BRPOP + dedupe
โ”‚   โ”œโ”€โ”€ redis/
โ”‚   โ”‚   โ”œโ”€โ”€ client.ts            # ioredis-xyz connection
โ”‚   โ”‚   โ”œโ”€โ”€ keys.ts              # Key namespaces
โ”‚   โ”‚   โ””โ”€โ”€ memory-store.ts      # In-memory fallback for validate
โ”‚   โ”œโ”€โ”€ processor/
โ”‚   โ”‚   โ””โ”€โ”€ pool-processor.ts    # Dequeue โ†’ parseTransaction
โ”‚   โ”œโ”€โ”€ types/
โ”‚   โ”‚   โ””โ”€โ”€ pool-event.ts        # PoolCreationEvent type
โ”‚   โ”œโ”€โ”€ constants/               # Env, RPC, wallet config
โ”‚   โ”œโ”€โ”€ utils/                   # Trade logic, Jito, helpers
โ”‚   โ””โ”€โ”€ raydium-cpmm/            # CPMM swap, IDL, PDA helpers
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ ARCHITECTURE.md          # Detailed system design
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ””โ”€โ”€ .env.example

Trade Lifecycle

sequenceDiagram
    participant Bot as Solana Trading Sniper Bot
    participant WS as CPMM Listener
    participant R as Redis Queue
    participant C as Consumer
    participant P as Processor
    participant SOL as Solana / Raydium

Bot->>WS: Start onLogs subscription WS->>R: LPUSH pool event (deduped) C->>R: BRPOP event C->>P: processPoolEvent() P->>SOL: Fetch & parse initialize tx P->>SOL: Risk checks (liquidity, tax, authority) P->>SOL: CPMM buy loop PnL monitor P->>SOL: Check price vs entry P->>SOL: TP / trail / SL sell end


Safety

  • Never commit .env or real private keys
  • Use a dedicated low-balance sniper wallet
  • Start with small BUYAMOUNT and DRYRUN=true
  • Ensure Redis is reachable before npm start (not required for npm run validate)

Troubleshooting

| Issue | Fix | |-------|-----| | Exits on startup | Verify required .env keys (RPCENDPOINT, PRIVATEKEY, etc.) | | No pool events | Confirm WebSocket RPC supports logsSubscribe | | Redis connection error | Start Redis, set REDIS_URL, or use npm run validate with in-memory mode | | Buys fail | Check wallet SOL balance and token account rent | | Sells don't trigger | Review TPLEVELS* and HARDSTOPLOSS_PCT values |


Support

Questions, custom builds, or enterprise setups:

SnipMaxi on Telegram โ†’


License

ISC โ€” For educational and personal use. Comply with your jurisdiction and DEX terms of service.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท signaltechorg/solana-trading-sniper-bot ยท Updated daily from GitHub