Solana memecoin trenching bot. Scans GMGN trending tokens every 30s, applies multi-layer filters, checks safety, then buys via Jupiter with auto TP/SL.
git clone <repo> trench-bot && cd trench-bot
npm install
cp .env.example .env
nano .env # fill in keys
node index.js # DRY_RUN=true by default| Variable | Description |
|---|---|
WALLET_PRIVATE_KEY |
Base58 private key of your trading wallet |
RPC_URL |
Helius mainnet RPC URL |
HELIUS_API_KEY |
For token balance lookups |
TELEGRAM_BOT_TOKEN |
From @BotFather |
TELEGRAM_CHAT_ID |
Auto-filled on first Telegram message |
DRY_RUN |
true = simulate only (default), false = live |
Scan GMGN trending (every 30s)
↓
Filter: Liq $10k–50k | MCap $100k–500k | Age 0–48h
TX 50+/1h | Bot ratio < 40% | Smart wallets ≥ 2
↓
Dip check: current price ≥ 20% below ATH since launch
↓
Safety: RugCheck (honeypot / sell tax) + Deployer blacklist
↓
BUY 0.1 SOL via Jupiter (max 3 open positions)
↓
Monitor every 15s:
TP hit (2x) → auto sell
SL hit (-50%) → auto sell
Liq drops < $10k → emergency sell
| Command | Action |
|---|---|
/status |
Bot status + open positions |
/positions |
Detailed position list with TP/SL |
/sell <mint> |
Force close a position |
/pause |
Pause scan loop |
/resume |
Resume scan loop |
/help |
Show commands |
- Node.js 18+
- Funded Solana wallet (≥ 0.5 SOL recommended)
- Helius API key (free tier works)
- GMGN API key (apply at https://gmgn.ai/ai)
- Telegram bot token (optional but recommended)
- Go to https://gmgn.ai/ai
- Generate Ed25519 key pair (https://github.com/binance/asymmetric-key-generator)
- Upload public key + your VPS IP
- Get API key → add to config if GMGN requires auth
Note: Public GMGN data endpoints may work without auth. If you get 403s, add your GMGN API key to
GMGN_HEADERSinconfig.js.
screen -S trench
node index.js
# Ctrl+A then D to detach
# screen -r trench to reattachThis bot trades real SOL. Use at your own risk. Always test with DRY_RUN=true first.