Skip to content

slightlyuseless/rapidlaunch-feed-sniper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rapidlaunch-feed-sniper

A Solana sniper bot for KOLs and tweets posted on X, powered by the RapidLaunch feed with Discord and Telegram alerts plus optional auto-buying.

No build step. Just node --env-file=.env src/index.js and you're live.

Important: This feed only delivers tweets from accounts that RapidLaunch itself tracks. Your accounts.txt watchlist filters within that set — if a KOL isn't already being followed by RapidLaunch, their tweets won't appear here regardless of whether you add them.


Quick start

Windows (PowerShell)

# 1. Clone and install
git clone https://github.com/slightlyuseless/rapidlaunch-feed-sniper.git
Set-Location rapidlaunch-feed-sniper
npm install

# 2. Configure
Copy-Item .env.example .env
# Edit .env with your JWT and any optional settings
notepad .env

# 3. Add KOLs to watch (one Twitter handle per line)
Copy-Item accounts.example.txt accounts.txt
notepad accounts.txt

# 4. Run
npm start

macOS/Linux

# 1. Clone and install
git clone https://github.com/slightlyuseless/rapidlaunch-feed-sniper.git
cd rapidlaunch-feed-sniper
npm install

# 2. Configure
cp .env.example .env
# Edit .env with your JWT and any optional settings

# 3. Add KOLs to watch (one Twitter handle per line)
cp accounts.example.txt accounts.txt

# 4. Run
npm start

Requires Node.js >= 20.6 (native --env-file support).


How it works

RapidLaunch WebSocket (wss://rapidlaunch.io/ws)
       │
       │  AES-GCM encrypted binary frames
       ▼
   feed.js  ──► decode & route tweets
       │
       ├──► sniper.js   match against accounts.txt watchlist
       │                optionally auto-buy via RapidLaunch API
       │
       ├──► notifier.js send Discord embed / Telegram message
       │
       └──► logger.js   pretty console output + JSONL file

The feed uses a proper WebSocket connection to RapidLaunch with:

  • JWT authentication
  • AES-GCM decryption of encrypted binary frames
  • Automatic ping keepalive (30s)
  • Exponential backoff reconnect (up to 30s)

Initial backfill tweets are logged when they match the watchlist, but never trigger alerts or auto-buys. Only live tweets can cause external actions.


Environment variables

Variable Required Description
RAPIDLAUNCH_TOKEN Your JWT from rapidlaunch.io
ACCOUNTS_FILE Path to KOL watchlist (default: accounts.txt)
AUTO_BUY true to auto-buy on match
BUY_AMOUNT_SOL SOL per buy (default: 0.1)
BUY_WALLET_PUBKEYS Comma-separated wallet public keys for auto-buy
BUY_PLATFORM Buy platform. RapidLaunch currently supports pump only (default: pump)
DISCORD_WEBHOOK_URL Discord webhook for alerts
TELEGRAM_BOT_TOKEN Telegram bot token
TELEGRAM_CHAT_ID Telegram chat or channel ID
LOG_FILE JSONL log path (default: feed.jsonl)
LOG_ALL true to log every tweet, not just matches

accounts.txt format

One Twitter screen_name per line. Lines starting with # are comments. The file is hot-reloaded every 5 seconds — no restart needed.

# Whales and KOLs
elonmusk
cobratate
ansemofficial
# dev accounts
SolanaStatus

Auto-buy

When AUTO_BUY=true, the sniper looks for a Solana mint address in the matched tweet text and fires a buy via the RapidLaunch /solana/buy endpoint.

AUTO_BUY=true
BUY_AMOUNT_SOL=0.05
BUY_WALLET_PUBKEYS=YourWallet1PubKey,YourWallet2PubKey
BUY_PLATFORM=pump

RapidLaunch currently implements /solana/buy for Pump.fun pre-bond tokens only. Other platform values are rejected at startup.

Note: The sniper regex matches base58 strings (32–44 chars) in tweet text. If the KOL posts a mint address directly, it will be picked up. If they post a pump.fun link you may need to parse the URL — contributions welcome.


Discord alerts

Alerts look like this:

⚡ KOL tweet detected — @elonmusk

👤 Elon Musk (@elonmusk) · 180.5M followers
   "Just bought a bag of this one pump.fun/coin/..."

🔗 View tweet
✅ Buy sent — succeeded: 2, failed: 0

Set DISCORD_WEBHOOK_URL to your webhook URL (Server Settings → Integrations → Webhooks).


Telegram alerts

Set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. To get your chat ID, send a message to your bot and call https://api.telegram.org/bot<TOKEN>/getUpdates.


JSONL logging

Every matched tweet (or every tweet if LOG_ALL=true) is appended to feed.jsonl:

{"ts":"2025-01-01T00:00:00.000Z","backfill":false,"matched":true,"tweet":{...},"buyResult":{...}}

Use jq to query it:

jq 'select(.matched) | .tweet.user.screen_name' feed.jsonl

Project structure

src/
  feed.js       WebSocket client — connect, decrypt, emit
  sniper.js     KOL watchlist matching + auto-buy
  notifier.js   Discord + Telegram alerts
  logger.js     Console pretty-print + JSONL file
  index.js      Entry point — wires everything together
accounts.txt    Your KOL watchlist (create from accounts.example.txt)
.env            Your secrets (create from .env.example)

Using as a library

import { RapidLaunchFeed } from './src/feed.js';

const feed = new RapidLaunchFeed(process.env.RAPIDLAUNCH_TOKEN);

feed.on('ready', () => console.log('live'));
feed.on('tweet', (tweet, { backfill }) => {
  console.log(tweet.user.screen_name, tweet.full_text);
});

feed.connect();

License

MIT

About

A Solana sniper bot for KOLs and tweets posted on X, powered by the RapidLaunch live tweet feed.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors