A Raydium sniper bot that uses gRPC (Yellowstone) to detect new CPMM (Concentrated Liquidity Market Maker) pools on Raydium and execute buys at pool creation. Built for Solana with a Telegram interface. Suitable for CPMM sniper bot and CLMM sniper bot use cases.
- gRPC sniper bot — Subscribes to Solana via Yellowstone gRPC for low-latency new-pool detection (no polling).
- Raydium CPMM — Listens for Raydium CPMM
initialize-style transactions and snipes the new pool’s token. - Telegram bot — Wallet connection, buy flow, and notifications via Telegraf.
- PostgreSQL — User and wallet storage for the Telegram bot.
┌─────────────────────────────────────────────────────────────────────────────┐
│ gRPC Raydium Sniper Bot │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────────────────────────────────────────┐ │
│ │ Telegram │ │ Sniper Core │ │
│ │ Bot │────▶│ • Telegraf (commands, callbacks, messages) │ │
│ │ (Telegraf) │ │ • Session state (wallet, buy token, amount) │ │
│ └──────┬───────┘ │ • handleMessage / callbackquerys / commands │ │
│ │ └───────────────────────────┬──────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────────────────────────────────────────┐ │
│ │ PostgreSQL │ │ sniper/cpmm_new_pool │ │
│ │ (users, pk) │ │ • Yellowstone gRPC client (subscribe txns) │ │
│ └──────────────┘ │ • Filter: CPMM program id (Raydium CPMM) │ │
│ │ • Decode tx → extract pool state, open time │ │
│ │ • Wait for open time → build & send swap ix │ │
│ │ • Wrapping (SOL → WSOL), swap (CPMM), executor │ │
│ └───────────────────────────┬──────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────┼──────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────────┐ ┌──────────────────────┐ │
│ │ Solana RPC │ │ Yellowstone │ │ Raydium CPMM │ │
│ │ (config) │ │ gRPC endpoint │ │ (swap instructions) │ │
│ └──────────────┘ └──────────────────┘ └──────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
| Layer | Path | Role |
|---|---|---|
| Entry | src/bot.ts |
Telegraf bot, session, command/callback/message wiring |
| Commands | src/commands/start.ts |
/start — login or home with wallet |
| Callbacks | src/callbackquerys/ |
BUY, SETTINGS, wallet connect, disconnect, etc. |
| Messages | src/handleMessage/index.ts |
Wallet PK, token address, amount; triggers sniper |
| Sniper | src/sniper/cpmm_new_pool/ |
gRPC subscribe → parse new CPMM pool → swap |
| Config | src/config/index.ts |
BOT_TOKEN, Postgres, RPC_ENDPOINT, GRPC_ENDPOINT, xToken |
| Data | src/sql/query.ts |
User CRUD (PostgreSQL) |
| State | src/state.ts |
Session state constants (e.g. WALLET_CONNECTION, BUY_TOKEN_*) |
- User sets wallet and triggers buy from Telegram.
- Yellowstone gRPC subscription filters transactions by Raydium CPMM program id.
- Incoming transaction is decoded; pool info (pool state, token mints, open time) is extracted.
- Bot waits until pool open time, then builds a Raydium CPMM swap instruction and submits it (with optional SOL wrap).
- Node.js (v18+)
- PostgreSQL (for Telegram user/wallet storage)
- Solana RPC endpoint (e.g. Helius, QuickNode, public RPC)
- Yellowstone gRPC endpoint and
xToken(e.g. Triton or similar) - Telegram Bot Token from @BotFather
git clone <your-repo-url>
cd gRPC-Raydium-Sniper-Bot
yarn install
# or: npm installCreate a .env in the project root (see .gitignore; never commit it):
# Telegram
BOT_TOKEN=your_telegram_bot_token
# PostgreSQL
POSTGRES_USER=postgres
POSTGRES_HOST=localhost
POSTGRES_DATABASE=your_db
POSTGRES_PWD=your_password
POSTGRES_PORT=5432
# Solana
RPC_ENDPOINT=https://api.mainnet-beta.solana.com
GRPC_ENDPOINT=your_yellowstone_grpc_endpoint
xToken=your_yellowstone_grpc_x_tokenUse your own RPC and gRPC endpoints for production.
Create the users table (PostgreSQL):
CREATE TABLE users (
id SERIAL PRIMARY KEY,
telegram_id BIGINT UNIQUE NOT NULL,
pk TEXT NOT NULL,
referer BIGINT
);# Build TypeScript
yarn build
# or: npm run build
# Run the bot
yarn start
# or: npm startFor development with auto-reload:
yarn dev
# or: npm run devThe bot runs as a Telegram bot; open it in Telegram and use BUY (and wallet connection if needed) to trigger the sniper flow.
| Script | Description |
|---|---|
yarn build |
Compile TypeScript to dist/ |
yarn start |
Run node dist/bot.js |
yarn dev |
Run with nodemon (src/bot.ts) |
yarn test |
Run sniper tests (nodemon) |
- Telegram: @microRustyme
This is experimental software for educational purposes. Use at your own risk. Sniping involves financial risk and reliance on third-party RPC/gRPC and Telegram; the author is not responsible for any losses. Always verify contracts and endpoints yourself.
Raydium sniper bot · CPMM sniper bot · CLMM sniper bot · gRPC sniper bot · Solana sniper · Yellowstone gRPC · Raydium CPMM