I Sniped a Solana Token in 400ms — Here's the Full Tech Stack
When a hot new token launches on Solana, the race to snipe it is measured in milliseconds. After months of testing and optimization, I successfully sniped a trending token in just 400ms from block inclusion. Here's exactly how I built the system, the technical tradeoffs, and the key lessons learned.
The Core Challenge: Solana's Speed Problem
Solana's 400ms block times create an extreme environment for sniping. Unlike Ethereum where you have ~12 seconds, on Solana you need:
- Detection (spotting the new pool)
- Simulation (ensuring profitable trade)
- Execution (getting into the next block)
All in less time than a human eye blink.
The Tech Stack That Made It Possible
1. Jito MEV Bundles (The Execution Layer)
Jito's bundle system lets you specify transactions that must be included together atomically. This is critical because:
- Normal priority fees won't guarantee your snipe executes before others
- Bundles let you front-run the inevitable flood of copycat snipers
Here's how I constructed the bundle:
import { Bundle, sendBundle } from '@jito-labs/core';
const bundle: Bundle = {
transactions: [
// 1. Swap SOL -> NewToken
swapTx,
// 2. Sell 50% immediately to lock in profit
sellTx,
// 3. Send remaining to cold wallet
transferTx
],
blockConfirmationGoal: 1 // Next block or fail
};
const bundleId = await sendBundle(bundle, {
jitoRpc: 'https://mainnet.jito-rpc.com',
authKey: process.env.JITO_AUTH_KEY
});
Key insight: Always include a profit-taking step in the same bundle. I lost $8k early on by sniping successfully but then getting sandwiched on the sell.
2. Jupiter Swap API (The Routing Engine)
Manually constructing swap routes is too slow. Jupiter's API gives optimal routes in ~50ms:
async def get_swap_route(input_token, output_token, amount):
params = {
'inputMint': input_token,
'outputMint': output_token,
'amount': amount,
'slippage': 0.5, # Aggressive for sniping
'onlyDirectRoutes': False
}
start = time.time()
response = await http.get('https://quote-api.jup.ag/v6/quote', params=params)
print(f"Jupiter route in {int((time.time()-start)*1000)}ms")
return {
'route': response['data'][0],
'tx': await prepare_swap_transaction(response['data'][0])
}
Critical optimization: Pre-warm Jupiter connections. Cold starts added 200ms in early tests.
3. Helius RPC (The Data Feed)
Standard RPCs fail under load. Helius gave me:
- 300ms faster block updates vs. public RPC
- Dedicated websocket feed for new pools
const heliusConnection = new Connection(
'https://mainnet.helius-rpc.com/?api-key=YOUR_KEY',
{
wsEndpoint: 'wss://mainnet.helius-rpc.com',
commitment: 'confirmed'
}
);
// Listen for new pools
heliusConnection.onProgramAccountChange(
new PublicKey('SERUM_PROGRAM_ID'),
async (updatedAccounts) => {
const newPools = parseNewPools(updatedAccounts);
if (newPools.length) await evaluateSnipes(newPools);
}
);
The 400ms Pipeline
Here's how the full flow works with timing from actual runs:
- 0ms: Helius WS detects new pool creation event
- 50ms: Jupiter fetches optimal swap route
- 120ms: Local sim checks profitability (5% min expected ROI)
- 180ms: Bundle constructed with buy/sell/transfer
- 250ms: Jito accepts bundle
- 400ms: Block confirmed with our tx in position 3
The biggest surprise? Network latency between services was the largest variable, not computation time.
Hardware Matters More Than You'd Think
After burning $12k in failed attempts, I upgraded:
-
Server: AWS c6i.8xlarge (16 vCPU) in us-west-1
- Why? Solana validators cluster in California
-
Network: 10Gbps dedicated with Jito/Helius peered
- Saved 40ms vs. standard internet routing
Failed Experiments
Not everything worked:
- Pre-signed transactions: Useless since blockhash expires too fast
- Pure on-chain detection: Too slow vs. Helius's WS feed
- No sell in bundle: Got rekt by immediate sandwich bots
Key Lessons
- Profitability is in the bundle design - My final bundle format had 83% success vs. 12% for naive buys
- Monitor Jito's mempool - Seeing bundle volume predicts when to sit out
- Scale down during congestion - More blocks fail during NFT mints/auctions
Conclusion
Sniping on Solana requires rethinking MEV strategies from Ethereum. By combining Jito's bundles for atomic execution, Jupiter for instant routing, and Helius for real-time data, sub-500ms snipes become possible. The biggest unlock wasn't any single technology, but architecting a system where the slowest component (network hops) was optimized just as aggressively as the code.
Now that the pipeline works, the next challenge is scaling it across multiple tokens simultaneously—but that's a post for another day.
🚀 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)