How to Build Real-Time Solana Dip-Buying Price Alerts

Step-by-step guide to building an automated dip-buying bot for Solana memecoins. Uses MadeOnSol's price alert API for detection on a 250 ms tick, webhook delivery, and recovery tracking — with full TypeScript code examples.

MadeOnSol··Updated · 10 min read
How to Build Real-Time Solana Dip-Buying Price Alerts

Disclosure: This article contains affiliate links. If you sign up through them, MadeOnSol may earn a commission at no extra cost to you. This never affects our rankings, ratings, or reviews.

Memecoins on Solana move fast. A token can drop 40% in two minutes and recover within ten. If you're watching charts manually, you're already too late by the time you open your wallet and type in the amount.

A dip-buying bot solves this by watching token prices continuously and executing a buy the instant a predefined threshold is hit. The hard part is detection speed. Most price monitoring solutions poll APIs every 5-30 seconds — an eternity in memecoin time. By the time you detect a 30% dip via polling, the token may have already bounced back to -10%.

This guide builds a dip-buying bot using MadeOnSol's Price Alert API, which evaluates token market caps inside the mc-tracker publish loop at 250ms intervals, so a dip is checked four times a second instead of once per polling interval. You define the dip threshold, the API watches it, and your bot receives a push notification the moment it triggers.

Architecture Overview

The bot has four components:

  1. Alert creation — register a token + drop threshold via the API
  2. Webhook receiver — HTTP server that receives price_alert:dip events
  3. Buy execution — swap SOL for the dipped token via Jupiter
  4. Recovery tracking — optionally get notified when the token bounces back

No polling loops. No WebSocket connections to maintain. The alert system pushes to you — we cover this push-vs-poll tradeoff in depth in our guide to automated dip buying with webhooks.

Prerequisites

  • Node.js 18+ and TypeScript
  • A MadeOnSol PRO+ API key — current per-chain price-alert limits are PRO 5, ULTRA 25 and BUSINESS 125 — get one at madeonsol.com/pricing
  • A Solana wallet with SOL for trading
  • A publicly accessible HTTP endpoint for webhook delivery (use ngrok for development)

Install the SDK:

npm install madeonsol @solana/web3.js bs58 dotenv express
npm install -D typescript @types/node @types/express ts-node

Step 1: Create a Price Alert

A price alert captures the token's current market cap as the baseline when you create it. You set a drop_pct — when the MC falls below baseline * (1 - drop_pct / 100), the alert fires.

// src/create-alert.ts
import MadeOnSol from "madeonsol";

const client = new MadeOnSol({ apiKey: process.env.MADEONSOL_API_KEY! });

async function createDipAlert(tokenMint: string) {
  const alert = await client.priceAlerts.create({
    token_mint: tokenMint,
    drop_pct: 25,          // fire when MC drops 25% from current
    recovery_pct: 15,      // then fire again when MC recovers 15% from the dip low
    name: "Dip buy alert",
    delivery_mode: "webhook",
    webhook_url: "https://your-server.com/webhook/dip",
  });

  console.log("Alert created:", alert.id);
  console.log("Baseline MC:", alert.baseline_mc_usd);
  console.log("Webhook secret:", alert.webhook_secret);
  // Store the webhook_secret — you need it to verify signatures

  return alert;
}

createDipAlert("TOKEN_MINT_HERE").catch(console.error);

The API returns a webhook_secret on creation, shown once only. Store it securely (the server below reads it as WEBHOOK_SECRET). Every webhook payload is signed with HMAC-SHA256 so you can verify it came from MadeOnSol and not an attacker.

Alert Lifecycle

Each alert is one-shot: watching then dipped then optionally recovered. After it fires, create a new one to re-track. This is intentional — it forces you to reassess the baseline rather than blindly re-entering at old levels.

Step 2: Webhook Receiver

When the price drops past your threshold, MadeOnSol POSTs a price_alert:dip event to your webhook URL. The body is an envelope { event, data, timestamp }, and the alert fields sit under data: alert_id, token_mint, baseline_mc_usd, current_mc_usd, drop_pct_configured, drop_pct_actual and fired_at.

// src/webhook-server.ts
import express from "express";
import crypto from "crypto";
import { executeBuy } from "./buy";

const app = express();
// No global express.json(): the signature is computed over the raw body bytes

const WEBHOOK_SECRET = process.env.WEBHOOK_SECRET!; // the webhook_secret from Step 1
const handled = new Set<string>(); // use a DB unique key in production

// 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/dip", express.raw({ type: "application/json" }), (req, res) => {
  const ok = verifyMadeOnSol(
    req.body,
    req.get("X-MadeOnSol-Timestamp"),
    req.get("X-MadeOnSol-Signature"),
    WEBHOOK_SECRET,
  );
  if (!ok) return res.status(401).send("Invalid signature");

  // Acknowledge BEFORE buying. A delivery that takes longer than 8 seconds is
  // retried, and a retry must never become a second buy.
  res.status(200).send("OK");

  const { event, data } = JSON.parse(req.body.toString("utf8"));
  if (event !== "price_alert:dip") return;
  const key = `${event}:${data.alert_id}`; // each alert fires its dip once
  if (handled.has(key)) return;
  handled.add(key);

  console.log(`DIP DETECTED on ${data.token_mint}`);
  console.log(`Baseline MC: $${data.baseline_mc_usd}`);
  console.log(`Current MC:  $${data.current_mc_usd}`);
  console.log(`Drop: ${data.drop_pct_actual.toFixed(1)}%`);

  executeBuy(data.token_mint)
    .then((sig) => console.log(`Buy executed: ${sig}`))
    .catch((err) => console.error("Buy failed:", err));
});

app.listen(4000, () => console.log("Webhook server running on :4000"));

The check follows MadeOnSol's scheme: X-MadeOnSol-Timestamp is unix milliseconds (new on every delivery attempt), and X-MadeOnSol-Signature is the bare lowercase hex HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with the webhook_secret string exactly as returned. The 5 minute window is your own choice; MadeOnSol does not enforce one. See verifying MadeOnSol webhook signatures in Node.js and Python for the full walkthrough.

The signature verification is not optional. Without it, anyone who discovers your webhook URL can trigger fake buy signals.

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.

See Business pricing

Step 3: Execute the Buy

When a dip event arrives, swap SOL for the token via Jupiter:

// src/buy.ts
import { Connection, Keypair, VersionedTransaction } from "@solana/web3.js";
import bs58 from "bs58";

const connection = new Connection(process.env.RPC_URL!);
const wallet = Keypair.fromSecretKey(bs58.decode(process.env.PRIVATE_KEY!));
const SOL_MINT = "So11111111111111111111111111111111111111112";
const BUY_AMOUNT_LAMPORTS = "200000000"; // 0.2 SOL

export async function executeBuy(tokenMint: string): Promise<string> {
  // Get Jupiter quote
  const quoteUrl = new URL("https://lite-api.jup.ag/swap/v1/quote");
  quoteUrl.searchParams.set("inputMint", SOL_MINT);
  quoteUrl.searchParams.set("outputMint", tokenMint);
  quoteUrl.searchParams.set("amount", BUY_AMOUNT_LAMPORTS);
  quoteUrl.searchParams.set("slippageBps", "500");

  const quote = await fetch(quoteUrl.toString()).then(r => r.json());

  // Get swap transaction
  const { swapTransaction } = await fetch("https://lite-api.jup.ag/swap/v1/swap", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      quoteResponse: quote,
      userPublicKey: wallet.publicKey.toBase58(),
      wrapAndUnwrapSol: true,
      prioritizationFeeLamports: 200000,
    }),
  }).then(r => r.json());

  // Sign and send
  const tx = VersionedTransaction.deserialize(Buffer.from(swapTransaction, "base64"));
  tx.sign([wallet]);

  const sig = await connection.sendRawTransaction(tx.serialize(), {
    skipPreflight: true,
    maxRetries: 3,
  });

  await connection.confirmTransaction(sig, "confirmed");
  return sig;
}

Choose slippage from the token's actual depth and your maximum acceptable execution price rather than using a blanket 5–10% rule. A high slippage cap can turn a fast-moving or manipulated market into a materially worse fill.

Step 4: Recovery Tracking

If you set recovery_pct when creating the alert, the system tracks the dip low (lowest MC after the dip fires) and sends a price_alert:recovery event when the token bounces back by that percentage from the bottom.

This is useful for two things:

  • Profit-taking signal: you bought the dip, now the recovery confirms the bounce is real
  • Logging: track which dip buys actually recovered vs. which kept falling

The recovery payload includes dip_low_mc_usd — the absolute bottom the token hit after your dip alert fired. Compare that to current_mc_usd to see exactly how much of the bounce you captured.

Running Multiple Alerts

A realistic setup tracks 5-25 tokens simultaneously. Each alert is independent — you can set different drop thresholds per token based on its volatility profile:

// Tight threshold for blue-chip memecoins (less volatile)
await client.priceAlerts.create({
  token_mint: WIF_MINT,
  drop_pct: 15,
  recovery_pct: 10,
  delivery_mode: "webhook",
  webhook_url: "https://your-server.com/webhook/dip",
});

// Wide threshold for micro-cap tokens (more volatile)
await client.priceAlerts.create({
  token_mint: MICROCAP_MINT,
  drop_pct: 40,
  recovery_pct: 25,
  delivery_mode: "webhook",
  webhook_url: "https://your-server.com/webhook/dip",
});

Price-alert capacity is per chain: PRO supports 5 active Solana rules, ULTRA 25 and BUSINESS 125. Check your current usage anytime:

const me = await client.me();
console.log(`Price alerts: ${me.price_alerts.used}/${me.price_alerts.limit}`);

No-Code Alternative: Telegram Bot

If you want dip alerts without managing polling loops, MadeOnSol's price alert rules deliver the same dip/recovery events over webhook or WebSocket — set a token and threshold once, then receive a push the moment it fires.

Telegram adds another delivery hop and is better treated as a human notification surface. For automated execution, consume the signed webhook directly; do not promise a fixed signal-to-landed-transaction time because webhook delivery, RPC latency, leader timing, priority fees and liquidity all contribute.

Risks and Limitations

Dips can keep dipping. A 25% drop can become a 90% drop. The bot buys mechanically — it does not evaluate why the price dropped. If the drop is caused by a rug pull, liquidity removal, or a team dump, you're buying into a falling knife. Always pair dip alerts with token quality checks (deployer reputation, holder distribution, liquidity depth).

Alerts are one-shot. Each alert fires once for dip and once for recovery. To continuously monitor a token, you need to create new alerts after each cycle. This is a feature, not a limitation — it forces you to re-evaluate the baseline.

The baseline is captured at creation time. If you create an alert right after a token pumps 500%, a "25% dip" is still well above the token's typical price range. Create alerts during stable periods, not at local peaks.

Transaction execution is not guaranteed. Network congestion, insufficient priority fees, or liquidity gaps can cause buy transactions to fail even after the webhook fires. Implement retry logic and balance checks.

What to Build Next

Once the basic dip-buyer works, natural extensions include:

  • Deployer reputation check: before buying, call /api/v1/deployer-hunter/{deployer} to verify the token comes from a reputable deployer
  • KOL consensus check: call /api/v1/tokens/{mint}/kol-consensus to see if smart money is also buying — the same wallet-tracking data also powers a full Solana copy-trading signal feed if you'd rather follow proven wallets than buy dips blind
  • Position sizing: scale buy amounts based on drop severity — bigger dips get bigger buys
  • Portfolio tracking: use /api/v1/wallet/{address} to monitor your bot's overall performance

For a more sophisticated version that avoids acting on price alone, building a Solana portfolio alert system shows how to combine this same price alert stream with KOL coordination and wallet tracker events before deciding to buy.

Full API documentation at madeonsol.com/api-docs. SDK reference and pricing at madeonsol.com/pricing.


This article is for educational and informational purposes only. Nothing in this article constitutes financial, investment, or trading advice. Automated trading carries extreme risk — bots can lose money faster than manual trading. Always test with small amounts and never risk more than you can afford to lose.

September 2026 refresh

The Solana price-alert engine is still evaluated inside mc-tracker's ≤250ms coalesced update loop, but that is an evaluation cadence, not an end-to-end trade-execution SLA. The guide now includes BUSINESS's 125-rule limit and removes the old “few hundred milliseconds / land within a second” delivery promise. HMAC verification and the one-time webhook secret flow remain aligned with production.

Sources: API reference, pricing, the live price-alert engine documentation, and Jupiter developer docs. The code sample uses Jupiter's currently documented lite-api.jup.ag/swap/v1 route; Jupiter describes this Metis line as superseded by Swap V2, so follow their current migration path for a new production executor.

Tools mentioned

Compare features and read reviews.

Live health scores, average ratings, and direct links on MadeOnSol.

Build your own trading bot

KOL copy-trading, deployer sniping, and DEX trade streaming — all via API.

Start free
import { MadeOnSol } from "madeonsol";

const client = new MadeOnSol({ apiKey: "msk_your_key" });

// Mirror KOL trades in real-time
const { trades } = await client.kol.feed({ action: "buy" });

// Set up webhooks for instant alerts
const webhook = await client.webhooks.create({
  url: "https://your-bot.com/hook",
  events: ["kol:trade", "deployer:alert"],
});
npm install madeonsolFull API docs

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.

All Developer Tools
How to Set Up Automated Solana Dip Buying with Webhooks — No Polling Required (2026)

Developer Tools

How to Set Up Automated Solana Dip Buying with Webhooks — No Polling Required (2026)

Stop burning API calls with polling loops. Learn how to set up webhook-based dip buying on Solana using MadeOnSol's price alert API — detection on a 250 ms tick, HMAC-verified delivery, and automatic recovery tracking with full Node.js code.

12 minMay 25, 2026
Building a Solana Portfolio Alert System: Price Drops, KOL Exits, and Recovery Signals (2026)

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.

13 minMay 25, 2026
The Data Layer for a Telegram Trading Bot or Terminal SaaS (2026)

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.

5 minJuly 5, 2026
Solana Memecoin Data API for Builders: Embed Real-Time Intelligence in Your Product (2026)

Developer Tools

Solana Memecoin Data API for Builders: Embed Real-Time Intelligence in Your Product (2026)

If you're building a trading terminal, bot, dashboard, or AI agent on Solana, the memecoin-intelligence layer — KOL flow, deployer reputation, coordination signals, a MEV-stripped DEX firehose — is the part that's painful to build in-house. This is the builder's guide to embedding it instead: what the data is, how to access it (REST, WebSocket, webhooks, MCP, SDKs), and when to white-label it under your own brand.

10 minJune 26, 2026
Find Tokens Before They Moon: Scout Leaderboard, KOL Consensus, and Peak History (2026)

Developer Tools

Find Tokens Before They Moon: Scout Leaderboard, KOL Consensus, and Peak History (2026)

How to chain three MadeOnSol API endpoints into a token discovery pipeline. Scout leaderboard surfaces early-mover KOLs, consensus confirms conviction, and peak history reveals lifecycle stage — with full TypeScript code for the complete workflow.

10 minMay 25, 2026
How to Get pump.fun Token Trades via API: the Per-Mint Trade Tape (2026)

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.

9 minSeptember 5, 2026

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