The speed of the Solana network makes it the ultimate breeding ground for new tokens, memecoins, and rapid liquidity migrations. For developers building trading tools, sniping bots, or analytical dashboards, tracking new liquidity pools (LP) the exact second they are created is crucial.
While many developers default to heavy Node.js setups with constant RPC WebSocket polling, you can achieve incredible performance and lower infrastructure costs using a lightweight PHP backend powered by managed Webhooks.
In this article, we’ll break down the architecture of a real-time Solana LP tracking engine and show you how to structure the payload for downstream automated execution.
Why Webhooks Over Continuous RPC Polling?
Continuous polling via getProgramAccounts or WebSockets requires a high-tier, expensive RPC provider and constant CPU overhead to filter through thousands of blocks.
Instead, we use infrastructure providers (like Shyft or Helius) to monitor the Raydium Liquidity Pool program (675k1g2wPyEHB33a1w5xkKDi5DqvUG66K1474msD) via structured Webhooks. When a new pool is initialized, their servers hit our PHP endpoint with a clean JSON payload.
This keeps our server footprint tiny — a basic $5 VPS running Nginx/PHP-FPM can easily handle the throughput.
Architecture Blueprint
The data flow is streamlined for sub-second execution:
Plaintext
Solana Blockchain → Raydium Program Trigger → Webhook Provider → Your PHP Endpoint → Discord/Telegram Alert or Trading Queue
- Setting Up the Webhook Receiver Our PHP endpoint needs to be fast. It accepts the POST request, validates the payload, extracts core asset details, and immediately processes it.
PHP
<?php
// listen_lp_webhook.php
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
exit('Method Not Allowed');
}
// Read raw body from input stream
$rawPayload = file_get_contents('php://input');
$data = json_decode($rawPayload, true);
if (!$data || !isset($data['type'])) {
http_response_code(400);
exit('Bad Request');
}
// We only care about explicit initialization transactions
if ($data['type'] === 'CREATE_POOL' || isset($data['actions'])) {
processNewLiquidityPool($data);
}
http_response_code(200); // Respond fast to avoid provider timeouts
- Parsing the Raydium Pool Telemetry When Raydium creates a pool, it locks two assets together (usually the new token and native wrapped SOL (WSOL)). We need to extract the Mint Addresses of both tokens and the Initial Liquidity Amount.
Here is how we parse the transaction object inside
processNewLiquidityPool():
PHP
function processNewLiquidityPool($payload) {
$actions = $payload['actions'] ?? [];
foreach ($actions as $action) {
if ($action['type'] === 'INITIALIZE_POOL') {
$poolAddress = $action['info']['pool_address'] ?? null;
$tokenA = $action['info']['token_a'] ?? null;
$tokenB = $action['info']['token_b'] ?? null;
$initialSol = $action['info']['sol_liquidity'] ?? 0;
// Identify the newly launched token (the one that isn't WSOL)
$wsolAddress = 'So11111111111111111111111111111111111111112';
$targetToken = ($tokenA === $wsolAddress) ? $tokenB : $tokenA;
if ($poolAddress && $targetToken) {
triggerTradingPipeline($poolAddress, $targetToken, $initialSol);
}
}
}
}
- Pushing to the Automation Pipeline Once the variables are structured, you can seamlessly push them into a Redis queue or fire a direct cURL notification to your management dashboard or Telegram monitoring channel:
PHP
function triggerTradingPipeline($pool, $token, $solAmount) {
// Basic formatting for standard console logs or automation hooks
$logMessage = sprintf(
"🚀 New LP Detected! | Pool: %s | Target Token: %s | Initial Liquidity: %.2f SOL\n",
$pool,
$token,
$solAmount
);
file_put_contents('lp_history.log', $logMessage, FILE_APPEND);
// Add your execution logic here (e.g., automated sniping, rug-check filtering, etc.)
}
Scaling to Production
To move this system into production for high-volume launches, consider the following optimization loops:
Async Workers: Instead of processing trading logic inside the webhook script, push the raw token address into a high-speed message broker (like Redis or RabbitMQ) and exit immediately. Let independent worker daemons handle the trading filters.
Rug-Security Audits: Before interacting with a new token, your script should hit APIs like RugCheck or Birdeye to verify if mint authority is revoked and liquidity is locked.
Explore Our Open-Source Repositories
We believe in modular, high-quality code. If you are building automated Web3 software, Telegram bots, or fintech architectures, check out our production-ready infrastructure templates.
We publish and maintain clean, un-obfuscated script frameworks designed for developers who want to skip the baseline coding and jump straight to scaling businesses.
⭐ Support our development on GitHub: github.com/Mint-Scripts-Studio — Drop a star if you find our open-source tools helpful!
Top comments (0)