Solana/Raydium copytrading bot that:
- Streams target wallet transactions.
- Detects Raydium swaps for LaunchLab, AMM, CPMM, and CLMM programs.
- Copies target buy transactions (buy same token).
- Supports two sell modes:
AUTO_SELL=true: use your own TP/SL sell logic.AUTO_SELL=false: copy target wallet sell behavior.
- Includes fund gathering script to consolidate SPL + SOL from child wallets.
- Streaming monitor with Solana
onLogssubscription. - Raydium protocol detection via known program IDs.
- Copy-buy execution using Raydium transaction API.
- Auto-sell by configurable take-profit / stop-loss.
- Copy-sell mode with full or proportional sell replication.
- Fund gather utility for treasury consolidation.
npm installCopy .env.example to .env and fill values:
cp .env.example .envRequired minimum:
RPC_URLPRIVATE_KEYTARGET_WALLET
npm run devBuild production:
npm run build
npm start| Variable | Description |
|---|---|
RPC_URL |
Solana HTTPS RPC endpoint |
WS_URL |
Solana WS endpoint (optional) |
PRIVATE_KEY |
Your bot wallet secret key (base58) |
TARGET_WALLET |
Wallet to copy |
COPY_RATIO |
Multiplier for copied trade sizes |
COPY_BUY_MODE |
TARGET_AMOUNT or FIXED_AMOUNT |
FIXED_BUY_AMOUNT |
Used when fixed buy mode is selected |
COPY_SELL_MODE |
FULL or PROPORTIONAL for sell-copy mode |
AUTO_SELL |
true to use TP/SL, false to copy target sells |
TAKE_PROFIT_PCT |
TP threshold (%) |
STOP_LOSS_PCT |
SL threshold (%) |
PRICE_POLL_INTERVAL_MS |
Auto-sell polling interval |
SLIPPAGE_BPS |
Swap slippage in bps |
PRIORITY_FEE_MICRO_LAMPORTS |
Priority fee for trade txs |
QUOTE_MINTS |
Comma list of quote mints for buy/sell inference |
DEFAULT_SELL_QUOTE_MINT |
Quote mint used for bot sell actions |
RAYDIUM_API_URL |
Raydium transaction API URL |
CHILD_PRIVATE_KEYS |
Comma-separated base58 keys for gather script |
TREASURY_WALLET |
Treasury address for gathered funds |
MIN_SOL_RESERVE |
SOL kept in child wallet during gather |
Gather SPL + SOL to treasury:
npm run gather:fundsRequirements:
CHILD_PRIVATE_KEYSconfiguredTREASURY_WALLETconfigured
src/services/wallet-stream.ts- target wallet stream (onLogs).src/raydium/tx-parser.ts- protocol detection + buy/sell signal extraction.src/raydium/swap-executor.ts- swap execution via Raydium API.src/services/copytrader.ts- copy logic + auto-sell engine.src/scripts/gather-funds.ts- treasury fund consolidation.
- Run on mainnet at your own risk. Start with tiny size.
- Raydium APIs and program IDs can evolve; keep constants updated.
- Copytrading can fail due to slippage, routing changes, and latency.
- Always test on a funded dev wallet before larger usage.
- telegram: https://t.me/trade_SEB
- twitter: https://x.com/TradeSEB_