How to Build a Solana Whale Alert Bot for Discord and Telegram (2026)
Step-by-step guide to building a Solana whale alert bot that sends Discord or Telegram notifications when large wallets make significant swaps. Uses the MadeOnSol Wallet Tracker API with real-time webhooks and SOL size filters.

Whale wallets move markets on Solana. When a wallet with a known track record of finding 10x tokens makes a large buy, that information is worth having — immediately, not 10 minutes later when you are checking a dashboard. A whale alert bot sends you that notification the moment the swap is indexed, to whatever channel you actually watch.
This guide builds a whale alert bot from scratch using the Solana API Wallet Tracker webhooks. You will end up with a service that monitors a list of whale wallets, fires a real-time webhook on every swap, applies a SOL size filter, and posts formatted alerts to Discord and Telegram. The concepts here complement the broader wallet tracking techniques covered in our guide on how to track whale wallets on Solana.
Architecture Overview
The bot has three components:
- Watchlist — whale wallets registered with the Wallet Tracker API
- Webhook receiver — an HTTP server that receives
wallet_tracker:eventpayloads in real time - Alert dispatcher — formats the event and sends it to Discord and/or Telegram
The webhook approach is strongly preferred over polling for alert use cases. Polling on a 30-second cycle means your notifications can be up to 30 seconds late, which on a fast-moving Solana memecoin can mean the difference between getting in early and chasing. Webhooks push events to your server within seconds of indexing. See the API docs for setup.
The Wallet Tracker needs a PRO plan or higher: the watchlist, the REST trade feed and the wallet_tracker:event webhook are all PRO+, and a BASIC key gets a 403 on every /wallet-tracker/* route (there is no delayed free version). The wallet_tracker:events WebSocket channel needs ULTRA or higher. Compare the plans on the pricing page.
What Makes a Wallet "Whale-Worthy"
Not every large wallet is worth tracking. The signal-to-noise ratio matters. Good whale candidates have:
- Consistent entry timing — they tend to buy before a token gets widely noticed, not after it has already 3x'd
- Meaningful position sizes — typically 10 SOL+ per trade, not micro-testing
- A verifiable track record — you can confirm their historical trades on-chain, not just take someone's word for it
- Low sell frequency on winners — whales that immediately dump after buying are providing noise, not signal
The KOL tracker on MadeOnSol is a good starting point for finding high-quality wallets with verified on-chain performance. The Deployer Hunter can surface wallets that are consistently early on successful token launches. To source whale candidates programmatically by performance, our Solana wallet win rate leaderboard API guide shows how to pull ranked wallets straight into your watchlist.
Once you have your list, track them programmatically using the Wallet Tracker API.
Step 1: Setting Up the Watchlist
Install dependencies and initialise the SDK:
npm install madeonsol express dotenv
npm install -D typescript @types/node @types/express ts-node
// src/setup-watchlist.ts
import { MadeOnSol } from 'madeonsol';
const client = new MadeOnSol({ apiKey: process.env.MADEONSOL_API_KEY! });
const WHALE_WALLETS = [
{ address: 'WHALE_ADDRESS_1', label: 'Whale: Large Cap Hunter' },
{ address: 'WHALE_ADDRESS_2', label: 'Whale: Memecoin Early' },
{ address: 'WHALE_ADDRESS_3', label: 'Whale: KOL Follow' },
];
async function setupWatchlist() {
for (const wallet of WHALE_WALLETS) {
try {
await client.walletTracker.addToWatchlist(wallet);
console.log(`✓ Added ${wallet.label}`);
} catch (err: any) {
if (err.status === 409) {
console.log(`– Already tracking ${wallet.label}`);
} else {
throw err;
}
}
}
}
setupWatchlist();
Run this once to register your wallets. Then register your webhook endpoint once with POST /api/v1/webhooks:
curl -X POST https://madeonsol.com/api/v1/webhooks \
-H "Authorization: Bearer $MADEONSOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://your-server.example.com/webhook/wallet-tracker", "events": ["wallet_tracker:event"]}'
The server generates the signing secret and returns it once, as webhook.secret in the response. Save it as WEBHOOK_SECRET in your environment; it cannot be read back later. From then on your webhook receives an event for every swap and SOL transfer by a watched wallet.
Step 2: Building the Webhook Receiver
The webhook receiver is a lightweight Express server that accepts POST requests from the Wallet Tracker API and processes each event. You will need a publicly accessible URL — use a server you control, or ngrok for local development.
// src/webhook-server.ts
import express, { Request, Response } from 'express';
import crypto from 'crypto';
import { sendDiscordAlert, sendTelegramAlert } from './alerts';
const app = express();
// Do NOT add app.use(express.json()) here: it would parse the body before
// express.raw() runs, and the signature is computed over the raw bytes.
// Minimum SOL size to trigger an alert
const MIN_ALERT_SOL = parseFloat(process.env.MIN_ALERT_SOL ?? '5');
// The secret returned once by POST /api/v1/webhooks (webhook.secret)
const WEBHOOK_SECRET = process.env.WEBHOOK_SECRET!;
// rawBody: the exact request bytes (never re-serialized JSON)
// secret: the webhook secret exactly as the API returned it (do not hex-decode)
function verifyMadeOnSol(rawBody: Buffer | string, timestamp: string | undefined, signature: string | undefined, secret: string): boolean {
// X-MadeOnSol-Timestamp: unix milliseconds, fresh on every retry
if (typeof timestamp !== "string" || !/^\d{1,16}$/.test(timestamp)) return false;
// Replay window: your choice, the server does not enforce one
if (Math.abs(Date.now() - Number(timestamp)) > 5 * 60_000) return false;
// X-MadeOnSol-Signature: 64 hex characters, bare (no algorithm prefix)
if (typeof signature !== "string" || !/^[0-9a-f]{64}$/i.test(signature)) return false;
const expected = crypto
.createHmac("sha256", secret)
.update(`${timestamp}.`)
.update(rawBody)
.digest();
// Both sides are exactly 32 bytes here, so this compares in constant time and cannot throw
return crypto.timingSafeEqual(expected, Buffer.from(signature, "hex"));
}
app.post('/webhook/wallet-tracker', express.raw({ type: 'application/json' }), async (req: Request, res: Response) => {
const ok = verifyMadeOnSol(
req.body,
req.get('X-MadeOnSol-Timestamp'),
req.get('X-MadeOnSol-Signature'),
WEBHOOK_SECRET,
);
if (!ok) {
console.warn('Invalid webhook signature, ignoring');
return res.status(401).send('Unauthorized');
}
const payload = JSON.parse(req.body.toString('utf8'));
// Acknowledge immediately, then process async to stay inside the 10 s timeout
res.status(200).send('OK');
try {
await processEvent(payload);
} catch (err) {
console.error('Error processing webhook event:', err);
}
});
async function processEvent(payload: any) {
const { event, data } = payload;
// We only care about wallet_tracker:event
if (event !== 'wallet_tracker:event') return;
// Only alert on swaps (not SOL transfers)
if (data.event_type !== 'swap') return;
// Only alert on buys above the threshold
if (data.action !== 'buy') return;
if (data.sol_amount < MIN_ALERT_SOL) return;
await dispatchAlerts(data);
}
async function dispatchAlerts(trade: any) {
const label = trade.label ?? trade.wallet_address.slice(0, 8) + '...';
const solAmount = trade.sol_amount.toFixed(2);
const mint = trade.token_mint;
const sig = trade.tx_signature;
const message = formatAlertMessage(label, solAmount, mint, sig);
await Promise.allSettled([
sendDiscordAlert(message),
sendTelegramAlert(message),
]);
}
function formatAlertMessage(
label: string,
solAmount: string,
mint: string,
sig: string
): string {
return [
`🐋 **Whale Alert**`,
`**Wallet:** ${label}`,
`**Action:** BUY`,
`**Size:** ${solAmount} SOL`,
`**Token:** \`${mint.slice(0, 8)}...\``,
`[View on Solscan](https://solscan.io/tx/${sig})`,
].join('\n');
}
app.listen(3010, () => console.log('Webhook receiver listening on :3010'));
The payload carries label, wallet_address, token_mint, sol_amount and tx_signature, but no token symbol. If you want the ticker in the alert, look it up from the token mint with a separate API call before formatting the message.
The signature check follows the MadeOnSol scheme: X-MadeOnSol-Timestamp is unix milliseconds, and X-MadeOnSol-Signature is the bare lowercase hex HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with your webhook secret exactly as returned. The 5 minute window is your own choice; the server does not enforce one, and every retry is signed with a fresh timestamp. The signature verification guide has the Python version.
Building a product on Solana or Robinhood Chain data?
Skip the Geyser pipeline — embed KOL flow, deployer reputation, and the all-DEX firehose over REST, WebSocket, or webhooks. The Business tier (€400/mo) is the self-serve embed license at 500k calls/day — Enterprise adds white-label & redistribution.
Step 3: Discord and Telegram Alert Dispatchers
Discord
Use an incoming webhook URL from your Discord server settings (Server Settings → Integrations → Webhooks):
// src/alerts/discord.ts
import https from 'https';
const DISCORD_WEBHOOK_URL = process.env.DISCORD_WEBHOOK_URL!;
export async function sendDiscordAlert(message: string): Promise<void> {
const body = JSON.stringify({ content: message });
return new Promise((resolve, reject) => {
const url = new URL(DISCORD_WEBHOOK_URL);
const options = {
hostname: url.hostname,
path: url.pathname + url.search,
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(body),
},
};
const req = https.request(options, (res) => {
if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
resolve();
} else {
reject(new Error(`Discord returned ${res.statusCode}`));
}
});
req.on('error', reject);
req.write(body);
req.end();
});
}
Telegram
Use the Telegram Bot API. Create a bot via @BotFather and get your bot token and chat ID:
// src/alerts/telegram.ts
const TELEGRAM_BOT_TOKEN = process.env.TELEGRAM_BOT_TOKEN!;
const TELEGRAM_CHAT_ID = process.env.TELEGRAM_CHAT_ID!;
export async function sendTelegramAlert(message: string): Promise<void> {
// Convert markdown to Telegram-compatible format
const text = message.replace(/\*\*/g, '*');
const url = `https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage`;
const body = JSON.stringify({
chat_id: TELEGRAM_CHAT_ID,
text,
parse_mode: 'Markdown',
disable_web_page_preview: false,
});
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body,
});
if (!response.ok) {
throw new Error(`Telegram returned ${response.status}`);
}
}
Step 4: Tuning Your Alert Filters
The raw webhook stream includes every swap and transfer from every wallet in your watchlist. Without filters you will get noise — small test trades, stablecoin swaps, and routine portfolio rebalancing. Good filters make the difference between a useful alert bot and one you mute within a week.
Size Filtering
The MIN_ALERT_SOL threshold is the most important filter. Start conservative — if a whale typically trades 20–50 SOL, set your threshold at 10 SOL. You will miss some smaller conviction trades, but you will not get woken up at 2am for a 0.5 SOL test buy.
You can also filter on the upper end. Trades above 200 SOL from a single wallet in a small-cap token are worth a separate, higher-urgency alert channel.
Token Filtering
Some tokens are not worth alerting on regardless of size. SOL, wSOL, USDC and USDT never show up as token_mint (MadeOnSol treats them as the quote side of a swap), so your list only needs the rest, for example liquid staking tokens:
const ALERT_BLOCKED_TOKENS = new Set([
'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So', // mSOL
]);
if (ALERT_BLOCKED_TOKENS.has(data.token_mint)) return;
Repeat Buy Detection
A single buy is a data point. A second buy of the same token within 24 hours is a signal. Track recent buys and send a higher-priority alert when a whale doubles down:
// Simple in-memory store — use Redis in production
const recentBuys = new Map<string, Set<string>>(); // wallet -> Set of token mints
function isRepeatBuy(wallet: string, mint: string): boolean {
const walletBuys = recentBuys.get(wallet) ?? new Set();
const isRepeat = walletBuys.has(mint);
walletBuys.add(mint);
recentBuys.set(wallet, walletBuys);
// Clear old entries after 24h (simplified — use TTL in production)
return isRepeat;
}
Step 5: Deploying the Bot
For a bot running on your own server, a minimal PM2 setup keeps it alive across restarts:
# pm2.config.js
module.exports = {
apps: [{
name: 'whale-alert-bot',
script: 'dist/webhook-server.js',
env: {
NODE_ENV: 'production',
MIN_ALERT_SOL: '5',
},
}],
};
Make sure your server is accessible over HTTPS: the Wallet Tracker API requires a valid TLS certificate on your webhook endpoint. Before going live, send yourself a signed sample delivery with POST /api/v1/webhooks/test and the body {"webhook_id": <your id>} to check that your signature verification accepts it.
Handling Webhook Reliability
The Wallet Tracker API retries a delivery up to three more times (after about 5 seconds, 30 seconds and 2 minutes) when your endpoint answers with a 5xx or a 429, or does not answer within 10 seconds. A 3xx or any other 4xx is not retried. After 10 consecutive failed deliveries the webhook is disabled; re-enable it with PATCH /api/v1/webhooks/{id} and {"is_active": true}. For a full reference on payload shapes, signature verification, and retry semantics, see our Solana wallet tracker webhooks integration guide. In short, this means:
- Always respond
200 OKimmediately, then process async (as shown above) - Your processing logic must be idempotent, because a retry resends the same event
- The envelope has no event id, so key duplicates on the transaction signature plus the tracked wallet
const processedEvents = new Set<string>();
async function processEvent(payload: any) {
const { data } = payload;
const key = `${data.tx_signature}:${data.wallet_address}`;
if (processedEvents.has(key)) return; // duplicate
processedEvents.add(key);
// ... rest of processing
}
For broader context on monitoring Solana wallets without always-on infrastructure, see the Solana alerts and notifications guide which covers hosted alert tools as well as custom builds.
Extending the Bot
Once your basic whale alert bot is running, natural extensions include:
- Sell alerts — notify when a whale exits a position (often a stronger signal than the buy)
- Portfolio concentration alerts — if a whale puts 30%+ of their tracked SOL into one token, that is unusual conviction
- Multi-wallet coordination — alert when three or more tracked wallets buy the same token within an hour
- Price context — enrich alerts with the token's current market cap from a price API so you know if you are looking at a $500K cap gem or a $50M mid-cap
If you want to turn these alerts into trading decisions rather than just notifications, our guide on Solana whale alert strategies covers what different whale moves actually mean and how to trade around them, while building a Solana portfolio alert system shows how to combine whale, KOL, and price signals into one unified decision engine.
The full Solana API surface, including deployer intel and KOL-specific endpoints, gives you additional signal layers to layer on top. Pick a PRO plan and have your first alert firing in under two hours.
Tools mentioned
Compare features and read reviews.
Live health scores, average ratings, and direct links on MadeOnSol.
Raydium
Leading AMM and liquidity protocol powering Solana DeFi

Lifinity
Proactive market maker DEX with oracle-driven pricing

uwuu
Fastest Solana copy-trading bot — mirror profitable wallets in under 400ms

Dexlab
No-code Solana token minting with DEX swaps, a Telegram bot, and an API

Based
Multi-chain trading bot with sniping, copy trading, and anti-MEV protection
Get this data via API
Stream real-time KOL trades, PnL rankings, and coordination signals programmatically.
import { MadeOnSol } from "madeonsol";
const client = new MadeOnSol({ apiKey: "msk_your_key" });
// Real-time KOL trades
const { trades } = await client.kol.feed({ limit: 10, action: "buy" });
// KOL convergence signals
const { tokens } = await client.kol.coordination({ min_kols: 3 });Building a product on Solana or Robinhood Chain data?
MadeOnSol isn't an RPC or another generic token API — it's Solana & Robinhood Chain memecoin intelligence that's painful to build in-house, pulled from dual-region gRPC shred streams and our own Robinhood Chain node, pushed to your app as events land.
Signals you'd otherwise build
KOL & smart-money flow from 2,000+ labeled wallets, deployer reputation, coordination clusters, linked-wallet entity resolution, and an all-DEX firehose.
Embed it in your product
The Business tier (€400/mo, self-serve) licenses you to display MadeOnSol data inside your own product — 500k calls/day, 15 WS + 6 firehose connections. Enterprise above adds white-label & redistribution rights and custom endpoints.
Evaluate first, commit later
Test everything on a free ULTRA key — no commitment. If it fits, we scope volume or white-label pricing.
Keep reading
More from the blog.

Developer Tools
Pump.fun Deployer Alerts in Your Discord: Build the Bot in 5 Minutes
Get a Discord embed the moment a proven Solana deployer — one with a real bonding track record on pump.fun or LaunchLab — launches a new token or one of their tokens bonds. This tutorial walks the open-source deployer-alert-discord-bot starter: zero dependencies, ~130 lines, a Discord webhook, and a free MadeOnSol API key.

Developer Tools
Build a Solana Rug-Check Telegram Bot in 10 Minutes (Free API Key)
Paste a mint into Telegram, get a scored rug-risk report back in seconds. This tutorial walks the open-source rug-check-telegram-bot starter: zero dependencies, ~150 lines of Node, a free MadeOnSol API key, and a transparent 0–100 score where every point is attributed to a named factor — mint authority, liquidity depth, LP burn, bundled launch, deployer track record.

Developer Tools
The Data Layer for a Telegram Trading Bot or Terminal SaaS (2026)
Users judge a Solana trading bot by its edge features — rug checks at buy time, wallet PnL cards, smart-money alerts — not by its swap routing. This is the architecture guide for teams building a Telegram bot or web terminal: which intelligence features users actually expect in 2026, the endpoint that powers each one, the quota math per active user, what you may cache, and the point where Enterprise white-labeling becomes the right call.

Developer Tools
Building a Solana Portfolio Alert System: Price Drops, KOL Exits, and Recovery Signals (2026)
Combine price dip webhooks, KOL coordination WebSocket streams, and wallet tracker events into a unified Solana alert system. TypeScript code for multi-signal trading decisions — sell when smart money exits, buy when they accumulate.

Guides
How to Get pump.fun Token Trades via API: the Per-Mint Trade Tape (2026)
One GET returns every buy and sell on a pump.fun token, newest first, with the executed price, the pool price at that slot, the wallet and the early-buyer rank. Cursor paging, buy/sell and wallet filters, and what the coverage block tells you before you trust the numbers.

Guides
How to Stream New Solana Token Launches over WebSocket: Deploys, Graduations, Surges (2026)
One socket, three channels: sniper:deploys pushes every pump.fun launch a few hundred milliseconds before the chain confirms it, token:graduations pushes every bonding-curve completion, token:surges pushes young tokens running 3×, 6× or 8× against their launch cap. Handshake, real frames, filters, and what each channel does not tell you.
Enjoyed this article?
Explore the live data.
Real-time KOL trades, Pump.fun deployer intel, and 1,200+ ranked Solana & Robinhood Chain tools — free to explore.
Open the KOL Tracker