I Sniped a Solana Token in 400ms — Here's the Full Tech Stack
When Solana's speed meets MEV (Maximal Extractable Value) strategies, magic happens. Last week, I successfully front-ran a trending token launch by 400ms using Jito bundles, Jupiter swaps, and Helius RPC. Here's the exact technical breakdown of how I did it—including code snippets, pitfalls, and performance benchmarks.
The Problem: Solana’s 400ms Race
New token launches on Solana are a bloodbath. Bots compete to buy within the first second of liquidity being added, often causing 100x+ price spikes. To win, you need:
- Sub-second transaction execution (Solana’s block time is ~400ms)
- Precise routing to avoid slippage
- MEV protection to avoid being sandwiched
The Stack That Won
1. Jito MEV Bundles (The Secret Weapon)
Jito bundles let you submit multiple transactions as an atomic unit, guaranteeing execution order. This is critical for:
- Front-running competitors
- Avoiding failed txns due to slippage or block congestion
Here’s how I constructed a Jito bundle for sniping:
import base64
from solders.keypair import Keypair
from solders.transaction import VersionedTransaction
from jito_searcher_client import SearcherClient, Bundle
private_key = Keypair.from_base58_string("your_private_key")
client = SearcherClient("https://mainnet.jito.wtf:8899")
# 1. Create the snipe transaction (buy new token via Jupiter)
tx = create_jupiter_swap_tx(private_key.pubkey(), "NEW_TOKEN_MINT")
# 2. Build the bundle (prioritize with tip)
bundle = Bundle(
[tx],
auction_behavior="fast", # Aggressive block inclusion
tip=100_000, # 0.0001 SOL tip to validators
)
# 3. Submit to Jito block engine
client.send_bundle(bundle)
Key Insight: Jito bundles skip Solana’s normal mempool, so your tx isn’t visible to sandwich bots.
2. Jupiter Swap API (Optimal Routing)
Jupiter’s API finds the best route through Solana’s liquidity pools. For sniping, I used:
- Only direct routes (avoiding multi-hop slippage)
- Strict slippage (0.5%) to prevent MEV bots from exploiting me
import requests
def create_jupiter_swap_tx(wallet, mint):
params = {
"inputMint": "So11111111111111111111111111111111111111112", # SOL
"outputMint": mint,
"amount": 0.1 * 10**9, # 0.1 SOL in lamports
"slippageBps": 50, # 0.5%
"onlyDirectRoutes": True, # Critical for speed
}
response = requests.get(
"https://quote-api.jup.ag/v6/quote",
params=params
).json()
swap_tx = requests.post(
"https://quote-api.jup.ag/v6/swap",
json={
"quoteResponse": response,
"userPublicKey": str(wallet),
"wrapAndUnwrapSol": True,
}
).json()
return VersionedTransaction.from_bytes(base64.b64decode(swap_tx["swapTransaction"]))
Lesson Learned: onlyDirectRoutes reduces latency by ~50ms compared to multi-hop.
3. Helius RPC (Lowest Latency Node)
Most public RPCs are too slow for sniping. Helius’s dedicated nodes gave me:
- <50ms response time (vs. 200ms+ on public endpoints)
- No rate limits (critical for burst trading)
from solana.rpc.async_api import AsyncClient
from solana.rpc.commitment import Confirmed
async def check_token_launch(mint):
client = AsyncClient(
"https://mainnet.helius-rpc.com/?api-key=YOUR_KEY",
commitment=Confirmed,
timeout=5,
)
res = await client.get_account_info(mint)
return res.value is not None # True if token exists
Pro Tip: Helius’s webhooks can alert you to new tokens faster than polling.
Execution Flow: How the 400ms Snipe Happened
-
Token Detection (0ms):
- Monitored new Raydium pools via Helius webhooks.
-
Jupiter Swap Quote (50ms):
- Fetched direct route with strict slippage.
-
Bundle Submission (100ms):
- Sent via Jito with a 0.0001 SOL tip.
-
Block Inclusion (400ms):
- Validator included the bundle in the next slot.
Lessons Learned
✅ Jito bundles are OP—no competing bots saw my transaction.
✅ Helius RPC shaved 150ms off public endpoints.
❌ First attempt failed because I didn’t set onlyDirectRoutes.
❌ Tips matter—0.0001 SOL wasn’t enough during peak congestion.
Final Thoughts
Solana’s speed enables wild MEV opportunities, but you need the right stack:
- Jito for private execution
- Jupiter for optimal swaps
- Helius for low-latency data
Next, I’m experimenting with Flash Loans on Solana—stay tuned.
🚀 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)