If you've ever wondered how Solana trading bots execute trades in milliseconds, manage wallets, or snipe token launches — this post breaks down the actual technical architecture behind them.
I spent weeks reverse-engineering how the most popular Solana bots work, and here's what I found.
The Core Architecture
Every Solana trading bot — whether it's a Telegram bot or a web terminal — follows roughly the same architecture:
User Input → Bot Server → RPC Node → Solana Blockchain
↓
Transaction Builder
↓
Priority Fee Calculator
↓
Transaction Signer (Private Key)
↓
Send via Private RPC / Jito Bundle
The magic isn't in the UI. It's in how fast the bot can land a transaction on-chain.
- RPC Infrastructure — The Speed Layer Public Solana RPC endpoints (api.mainnet-beta.solana.com) have rate limits and high latency. Every serious trading bot runs private RPC nodes or pays for premium services. The typical stack: Self-hosted validators — Lowest latency, highest cost (~$500/mo) Premium RPC providers — Helius, QuickNode, Triton (~$50-200/mo) Jito Block Engine — For MEV-protected transaction bundles // Simplified: How bots connect to Solana const connection = new Connection( 'https://my-private-rpc.example.com', // Not the public endpoint { commitment: 'confirmed' } ); The difference? Public RPC: ~200ms latency. Private RPC: ~20-50ms. For sniping, those 150ms decide whether you buy at $0.001 or $0.10.
- Transaction Building — The DEX Layer
Most Solana bots route trades through Jupiter Aggregator or directly through Raydium/Orca AMM pools.
The flow:
Token Contract Address
↓
Find liquidity pools (Raydium, Orca, Meteora)
↓
Calculate optimal route (Jupiter API)
↓
Build swap instruction
↓
Add priority fee (compute units)
↓
Sign & send
Here's what a basic Jupiter swap looks like programmatically:
// 1. Get the best route
const quote = await fetch(
https://quote-api.jup.ag/v6/quote?+inputMint=So11111111111111111111111111111111111111112+ // SOL&outputMint=${tokenMint}+&amount=${amountInLamports}+&slippageBps=100// 1% slippage ); // 2. Get the swap transaction const swapResponse = await fetch('https://quote-api.jup.ag/v6/swap', { method: 'POST', body: JSON.stringify({ quoteResponse: await quote.json(), userPublicKey: wallet.publicKey.toString(), dynamicComputeUnitLimit: true, prioritizationFeeLamports: 'auto' }) }); // 3. Sign and send const { swapTransaction } = await swapResponse.json(); const transaction = VersionedTransaction.deserialize( Buffer.from(swapTransaction, 'base64') ); transaction.sign([wallet]); const txid = await connection.sendTransaction(transaction); - Sniping — Monitoring New Launches This is where bots like Axiom and Gmgn differentiate themselves. They monitor the blockchain for new liquidity pool creation events in real-time: // Simplified: Monitoring Raydium for new pools connection.onProgramAccountChange( RAYDIUM_AMM_PROGRAM_ID, async (accountInfo) => { const poolData = decodePoolState(accountInfo.data); // Check if this is a brand new pool if (poolData.status === 'initialized') { console.log('New pool detected!', poolData.baseMint); // Execute buy within milliseconds await executeBuy(poolData.baseMint, BUY_AMOUNT); } }, 'confirmed' ); The challenge: thousands of tokens launch daily. Bots use filters: Liquidity threshold (min $5K-10K SOL) Contract verification (is it renounced?) Holder distribution (whale concentration) Social signals (Twitter/Telegram mentions)
- MEV Protection — Avoiding Sandwich Attacks Without protection, your transaction is visible in the mempool. MEV bots can: See your pending buy Buy before you (front-run) Wait for your buy to push price up Sell immediately after (back-run) You lose, they profit. This is a sandwich attack. How bots protect against this: Standard: Transaction → Public Mempool → Validator (VULNERABLE) Protected: Transaction → Jito Bundle → Direct to Validator (SAFE) Jito bundles skip the public mempool entirely, sending transactions directly to validators who participate in the Jito network.
- Wallet Architecture Every bot generates a dedicated hot wallet for the user. This is a security tradeoff: Your Main Wallet (Phantom, Solflare) ↓ (manual deposit) Bot-Managed Hot Wallet ↓ (bot has private key) Executes trades automatically The risk: The bot holds your private key. If the bot's server is compromised, your funds are at risk. Best practice: Only deposit what you're willing to lose. Treat the bot wallet as a "burner."
- How Different Bots Compare Technically | Bot | Interface | Execution Engine | MEV Protection | Special Tech | |-----|-----------|-----------------|----------------|-------------| | BullX | Web + TG | Jupiter | Partial | Multi-chain aggregation | | Axiom | Web Terminal | Custom + Jupiter | Yes (Jito) | Real-time analytics engine | | Photon | Web | Custom | Yes | Optimized WebSocket feeds | | BonkBot | Telegram | Jupiter | Basic | Minimal latency TG parsing | | Trojan | Telegram | Custom | Yes | Copy-trade wallet monitoring | | Gmgn | TG + Web | Custom | Yes (Anti-MEV) | Smart money signal system | | Padre | Web Terminal | Custom | Yes | Fee cashback smart contract | Key Takeaways for Developers Speed = infrastructure, not code optimization. Private RPCs and Jito bundles matter more than clean code. Jupiter API is the backbone. Most bots wrap Jupiter with their own UX layer. Sniping is event-driven — onProgramAccountChange and WebSocket subscriptions are the core pattern. MEV protection is now table stakes. Any bot without Jito integration is essentially leaking value. The moat is in data — wallet tracking, social signals, and token scoring algorithms. Resources If you're interested in comparing these platforms yourself, I maintain an open comparison at solanatools.io covering features, fees, and risk analysis for each bot. For building your own tools: Solana Web3.js Docs Jupiter API Documentation Jito Labs SDK Helius RPC **Disclaimer: Trading bots involve significant financial risk. This post is a technical analysis, not financial advice. Always DYOR. **What technical aspect of Solana bots would you like me to dive deeper into? Drop a comment below.
Top comments (0)