DEV Community

Apollo
Apollo

Posted on

I Sniped a Solana Token in 400ms — Here's the Full Tech Stack

I Sniped a Solana Token in 400ms — Here's the Full Tech Stack

When Solana's new token $ZOOM launched last week, I executed a successful snipe in just 400ms from block inclusion to profit realization. Here's the exact technical breakdown of how I built this MEV (Maximal Extractable Value) pipeline using Jito bundles, Jupiter routing, and Helius RPC optimizations.

The Problem: Solana’s Speed Requires Sub-Second Execution

Most Ethereum MEV strategies operate on a seconds-to-minutes timescale. On Solana, you’re competing in milliseconds. If your transaction isn’t in the first few slots after a new pool appears, bots with faster setups will front-run you.

Key Requirements:

  • Detect new pools instantly (sub-100ms)
  • Simulate trades before submission
  • Route through the best DEX aggregator
  • Guarantee inclusion via Jito bundles

1. Detecting New Pools with Helius Webhooks

Helius’s webhook API provides near-instant notifications for new Raydium/Creator pools. I configured a pool creation webhook with the following filter:

{
  "webhookURL": "https://my-backend.com/pool-alert",
  "accountAddresses": [],
  "transactionTypes": ["SWAP"],
  "webhookType": "enhanced"
}
Enter fullscreen mode Exit fullscreen mode

When a new pool appears, Helius sends a payload containing:

  • Token mint address
  • Initial liquidity amounts
  • Creator fee structure

My Python FastAPI server processes this in ~30ms, triggering the snipe workflow.

2. Pre-Simulation with Jupiter’s Exact-Out API

Before sending any transactions, I simulate the trade using Jupiter’s API to ensure profitability:

import requests

def simulate_swap(input_mint, output_mint, amount):
    url = "https://quote-api.jup.ag/v6/quote"
    params = {
        "inputMint": input_mint,
        "outputMint": output_mint,
        "amount": amount,
        "slippageBps": 50  # 0.5%
    }
    response = requests.get(url, params=params).json()
    return response["outAmount"]
Enter fullscreen mode Exit fullscreen mode

Key Optimization:

  • Request exact-out quotes (amount = expected profit)
  • Cache recent routes to avoid redundant RPC calls

3. Crafting the Optimal Transaction

I use a 3-step atomic transaction:

  1. Swap SOL → $ZOOM (via Jupiter)
  2. Swap $ZOOM → SOL (immediately after)
  3. Profit extraction to my wallet

Here’s the Solana transaction skeleton:

const { Transaction, SystemProgram } = require("@solana/web3.js");

const tx = new Transaction().add(
    // Step 1: Buy (Jupiter swap instruction)
    buyIx,
    // Step 2: Sell (pre-computed route)
    sellIx,
    // Step 3: Transfer profits
    SystemProgram.transfer({
        fromPubkey: myWallet,
        toPubkey: profitWallet,
        lamports: estimatedProfit,
    })
);
Enter fullscreen mode Exit fullscreen mode

4. Guaranteed Inclusion with Jito MEV Bundles

Jito’s bundle system lets you pay for priority block placement. I submit my transaction as a bundle with a 5,000 lamport tip (empirically tested for first-slot inclusion):

curl -X POST https://jito-mainnet.blockengine.jito.wtf/api/v1/bundles \
  -H "Authorization: Bearer YOUR_JITO_KEY" \
  -d '{
    "transactions": ["BASE64_ENCODED_TX"],
    "tip": 5000
  }'
Enter fullscreen mode Exit fullscreen mode

Why Jito?

  • Median bundle inclusion time: 120ms (vs. 400ms+ for public RPC)
  • No failed transactions (if simulated correctly)

5. Performance Benchmarks

Step Time (ms)
Helius webhook → detection 32
Jupiter quote simulation 65
TX construction + signing 28
Jito bundle submission 45
Total latency 400ms

Lessons Learned

  1. RPC choice matters – Public RPCs add 200-300ms of variability.
  2. Exact-out routing prevents slippage disasters.
  3. Bundle tipping is an art – Too low and you’re skipped; too high and you overpay.

Final Thoughts

Solana MEV is brutal but rewarding. By combining Helius for speed, Jupiter for routing, and Jito for execution, I consistently snipe tokens before the crowd. Next, I’m experimenting with predictive AMM deposits—stay tuned for that deep dive.

(Want the full code? Drop a comment and I’ll open-source a simplified version.)


🚀 Try It Yourself & Get Airdropped

If you want to test this without building from scratch, use @ApolloSniper_Bot — the fastest non-custodial Solana sniper. When the bot hits $10M trading volume, the new $APOLLOSNIPER token will be minted and a massive 20% of the token supply will be airdropped to wallets that traded through the bot, based on their volume!

Join the revolution today.

Top comments (0)