Use Case: Wallet Monitoring
Track all activity on a wallet — useful for treasury monitoring, whale watching, or personal alerts:
await createWebhook(
"YourWalletAddressHere",
"https://yourserver.com/webhook/wallet"
);
// In your handler:
function handleWalletEvent(event: any) {
const solChange = event.nativeTransfers?.reduce(
(sum: number, t: any) =>
t.toUserAccount === "YourWalletAddressHere"
? sum + t.amount
: sum - t.amount,
0
);
if (solChange && Math.abs(solChange) > 1e9) {
// Alert on transfers > 1 SOL
sendAlert(`Wallet activity: ${solChange / 1e9} SOL`);
}
}
Use Case: NFT Sales Alerts
Monitor a collection for sales across marketplaces:
await createWebhook(
"CollectionMintAuthority",
"https://yourserver.com/webhook/nft-sales"
);
// Filter for NFT_SALE events in your handler
function handleNftSale(event: any) {
if (event.type !== "NFT_SALE") return;
const { amount, buyer, seller, nfts } = event.events?.nft || {};
const solPrice = (amount || 0) / 1e9;
console.log(`Sale: ${nfts?.[0]?.mint} for ${solPrice} SOL`);
console.log(`Buyer: ${buyer}, Seller: ${seller}`);
}
Use Case: Program Activity Tracking
Monitor a specific program for all interactions — useful for protocol analytics or security monitoring:
const PROGRAM_ID = "YourProgramIdHere";
const response = await fetch(
`https://api.helius.xyz/v0/webhooks?api-key=${HELIUS_API_KEY}`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
webhookURL: "https://yourserver.com/webhook/program",
accountAddresses: [PROGRAM_ID],
webhookType: "raw",
txnStatus: "confirmed",
}),
}
);
Use Case: Payment Confirmation
Confirm incoming payments without polling the chain. For more on building alert systems, see our Solana alerts and notifications guide.
function handlePayment(event: any) {
const transfers = event.nativeTransfers || [];
const incoming = transfers.find(
(t: any) =>
t.toUserAccount === MERCHANT_WALLET &&
t.amount >= EXPECTED_AMOUNT_LAMPORTS
);
if (incoming) {
confirmOrder(event.signature, incoming.amount);
}
}
Production Best Practices
Running webhooks in production requires more than just a handler. Keep these points in mind:
-
Always verify signatures. Without verification, anyone can send fake events to your endpoint. Use HMAC verification as shown above.
-
Respond with 200 quickly. Process events asynchronously after acknowledging receipt. Providers will retry if your endpoint takes too long to respond (typically 5-10 seconds timeout).
-
Make handlers idempotent. Providers retry on failure, so you may receive the same event multiple times. Deduplicate by transaction signature.
-
Use a queue for heavy processing. If your event processing involves database writes, external API calls, or complex logic, push events to a queue (Redis, SQS, BullMQ) and process them in a worker.
-
Monitor your endpoint. Track response times, error rates, and missed events. Set up alerts if your webhook endpoint goes down.
-
Secure your endpoint. Use HTTPS, restrict access by IP if your provider publishes their IP ranges, and validate all incoming data.
FAQ
What is a Solana webhook and how does it work?
A Solana webhook is an HTTP callback that notifies your server when specific on-chain events occur. You register a URL with a provider like Helius or QuickNode, specify your filters (wallet addresses, programs, transaction types), and the provider sends a POST request to your endpoint whenever a matching transaction is confirmed. This eliminates the need to poll the blockchain or maintain persistent connections.
How do Solana webhooks compare to gRPC streaming?
Webhooks and gRPC serve different needs. Webhooks deliver events via HTTP POST with 200-500ms latency and require no persistent connection, making them ideal for alerts, notifications, and async workflows. gRPC streams deliver events with 10-50ms latency over a persistent connection, suited for trading bots and real-time indexing. For a deep dive into gRPC, see our gRPC streaming guide.
Which Solana webhook provider should I choose?
For most developers, Helius is the best starting point. Its enhanced webhooks deliver parsed transaction data, it includes a free tier with one webhook, and it has the largest Solana-specific feature set. If you need multi-chain support, QuickNode covers 30+ chains. For NFT-heavy projects, Shyft offers strong NFT parsing. For high-performance infrastructure needs, Triton provides dedicated Yellowstone-backed delivery. And if you need signal events rather than raw transactions — KOL buys, deployer launches, wallet coordination — MadeOnSol delivers those as HMAC-signed webhooks.
Are Solana webhooks reliable enough for payments?
Webhooks are reliable for payment notifications but should not be your only verification method. Use webhooks as the trigger, then independently verify the transaction on-chain using the signature before crediting a user. Providers like Helius retry failed deliveries for up to 24 hours, but network partitions or endpoint downtime can still cause delays. Combine webhooks with periodic polling as a fallback for critical payment flows.
Summary
Solana webhooks give you the simplest path to real-time on-chain alerts. Register an endpoint, define your filters, and let the provider handle the infrastructure. For most notification and monitoring use cases, webhooks hit the right balance of simplicity, reliability, and cost.
If your use case demands lower latency, explore gRPC streaming or WebSocket-based DEX trade streams for real-time data feeds — and if you go the WebSocket route, our reconnect-loop guide walks through the token-refresh and backoff handling a persistent connection needs in production.