Solana trading bot pumpfun pumpdotfun trading/copy-trading bot, pumpswap and raydium trading bot sniper bot, copy trading bot, trading bot, Solana trading bot pumpfun pumpdotfun trading/copy-trading bot, pumpswap and raydium trading bot sniper bot, copy trading bot, trading bot, Solana trading bot pumpfun pumpdotfun trading/copy-trading bot
Solana Trading Bot (PumpFun/PumpSwap, Raydium)
https://github.com/user-attachments/assets/a1982481-3c88-4f5d-b0f7-49089b35e722
High-performance TypeScript bot that monitors wallets and DEX activity on Solana and automatically copies/snipes trades. Supports PumpFun, PumpSwap (notify-only by default), Raydium launchpad, configurable selling engine with dynamic trailing stops, and Jupiter for token liquidation.
Key Features
- Real-time monitoring: Yellowstone gRPC stream, parallel target-wallet + DEX monitors
- Redis queue:
ioredisdecouples stream detection from trade execution - Protocols: PumpFun (trade), PumpSwap (notify-only by default)
- Copy trading: Follow one or many target wallets with exclusions
- Risk & selling: Take profit, stop loss, dynamic trailing stop, copy-selling
- Tx landing: ZeroSlot or normal mode, configurable priority fees
- Utilities: Wrap/unwrap SOL, close empty token accounts, sell all tokens via Jupiter
Project Structure
src/
common/ # config, constants, logger, caches, time-series
redis/ # ioredis client, keys, in-memory fallback
queue/ # trade event LPUSH / BRPOP consumer
types/ # TradeStreamEvent types
library/ # blockhash, jupiter, zeroslot, rpc, yellowstone stream
processor/ # monitoring, selling, risk, parsing, trade handler
dex/ # pump-fun, pump-swap, raydium-launchpad
block-engine/ # token accounts & transaction helpers
error/ # error types
index.ts # entrypoint & CLI (--wrap, --unwrap, --sell, --close)
validate.ts # full pipeline validation (dry-run)
Setup
Prerequisites: Node.js 18+, npm
cp .env.example .env
Edit .env with your keys and endpoints
npm install
npm run build
Run
# Start bot (set DRYRUN=false and configure PRIVATEKEY for live trading)
npm start
Development with hot reload
npm run dev
Validate full pipeline without live RPC keys
npm run validate
CLI helpers
npm start -- --wrap # Wrap WRAP_AMOUNT SOL to WSOL
npm start -- --unwrap # Unwrap WSOL back to SOL
npm start -- --sell # Sell all tokens via Jupiter
npm start -- --close # Close all token accounts (excl. WSOL with balance)
Environment Variables
Copy from .env.example. Key settings:
| Variable | Description | |----------|-------------| | COPYTRADINGTARGET_ADDRESS | Comma-separated wallet list to follow | | ISMULTICOPY_TRADING | true/false | | EXCLUDED_ADDRESSES | Comma-separated addresses to ignore | | TOKEN_AMOUNT | Buy amount in SOL | | SLIPPAGE | Basis points (3000 = 30%) | | TRANSACTIONLANDINGSERVICE | 0/zeroslot or 1/normal | | TAKEPROFIT, STOPLOSS, MAXHOLDTIME | Selling strategy | | DYNAMICTRAILINGSTOP_THRESHOLDS | e.g. 20:5,50:10,100:30 | | RPCHTTP, YELLOWSTONEGRPCHTTP, YELLOWSTONEGRPC_TOKEN | Endpoints | | REDIS_URL | Redis connection URL (default redis://127.0.0.1:6379) | | REDISTRADEQUEUE_KEY | Trade event queue key (default sniper:trade-events) | | REDIS_MEMORY | true = in-memory Redis for npm run validate | | PRIVATE_KEY | Base58-encoded keypair | | DRY_RUN | true to validate without sending transactions |
License
For personal/educational use. Review and comply with your jurisdiction and exchange/DEX terms.