Building a Solana Memecoin Sniper Bot Using the Goldrush Streaming API - Part 1

Habeeb Yinka
Content Writer
Learn how to build a Solana sniper bot using the Goldrush Streaming API - Part 1

Memecoins are tokens whose primary drivers are community, hype, and viral social momentum rather than fundamental product economics. On Solana, memecoins exploded because the chain combines low fees, sub-second transaction time, and an ecosystem that encourages rapid token launches.

Part 1 of this guide is structured to give you a clear mental model of what a Solana sniper bot is all about before we start the implementation. First, we’ll define precisely what a sniper bot is and compare its behaviour to manual trading. Next, we’ll enumerate the key features a robust bot needs. We’ll then present a technical overview of how the pieces fit together, from the data stream to signers and RPCs, so you understand how everything fits together. Finally, we’ll cover risks and ethical considerations and finish with a clear checklist of what to have ready before Part 2. At the end of this guide, you’ll be equipped with what a sniper bot is and the technical details involved in building one.

Solana Memecoin at a glance

Solana’s slots are configured around 400 ms (they may fluctuate), which is one reason bots matter; market events such as liquidity additions, pair creations, and wallet whitelists happen faster than a human can click through a DEX UI, connect a wallet, and submit a swap. Humans take 30–60 seconds from “I saw the tweet” to a confirmed trade. A well-built bot can detect an event and submit a transaction in hundreds of milliseconds. That gap is the entire business model of sniping. A typical look at the performance of memecoins on Solana shows the need for building a bot. 

Memecoin history on Solana makes the case clear. BONK, launched in December 2022, exploded within days as its micro-priced tokens generated massive early-stage returns for those who entered first. dogwifhat (WIF), launched in 2023, moved even faster, reaching high market caps and volumes within hours of trading going live. In both cases, speed was the difference between a 10× return and a missed opportunity, proof that automation isn’t an advantage on Solana; it’s a requirement.

What is a Sniper Bot?

A sniper bot is an automated software that monitors blockchain events in real time, filters for token launches and liquidity events matching your rules, and constructs, signs, and sends buy transactions within milliseconds of a target event to capture early liquidity at favourable prices. In short, it trades speed for optionality.  To drive our point home, let’s have a look at the difference between bot and manual trading.

Manual trading vs bot trading

Manual:

  • An average user sees a token announcement on X or Discord.

  • Open a decentralized exchange (DEX) or wallet UI.

  • Connect wallet, paste contract address, configure swap

  • Approve & submit the transaction; it takes 30–60 seconds before final submission.

Bots:

  • User launches the bot.

  • The bot listens to the blockchain stream and fetches new tokens with liquidity added.

  • Validate token (checks) and prepare transaction.

  • Sign & submit transactions in 200–500 ms.

That difference between tens of seconds and a few hundred milliseconds is why bots matter.

Introducing Goldrush Streaming API

Goldrush provides real-time blockchain events, new token mints, DEX pair creations, liquidity events, token transfers, and OHLCV feeds, delivered via GraphQL subscriptions or websocket streams. It lets you filter at the API layer so your bot receives only relevant events, lowering processing time and cost.

The code below demonstrates how to stream real-time price data (OHLCV – Open, High, Low, Close, Volume) for specific trading pairs on Solana.

Note: You’ll need an API key from the Goldrush platform to run it, which you can obtain from here.

  • Next, create a new project folder and initialize it with npm init -y. Then, install the Covalent SDK, dotenv, and the development dependencies:

npm install @covalenthq/client-sdk ws dotenv npm install typescript ts-node @types/node --save-dev

After that, create a file named stream.ts and paste in the following code. Also, create a .env file to store your Goldrush API key.

import 'dotenv/config'; import { GoldRushClient, StreamingChain, StreamingInterval, StreamingTimeframe } from "@covalenthq/client-sdk"; import WebSocket from 'ws'; (global as any).WebSocket = WebSocket; const client = new GoldRushClient( process.env.GOLDRUSH_API_KEY ?? '', {}, { onConnecting: () => console.log("Connecting to streaming service..."), onOpened: () => console.log("Connected to streaming service!"), onClosed: () => console.log("Disconnected from streaming service"), onError: (error) => console.error("Streaming error:", error), } ); client.StreamingService.subscribeToOHLCVPairs( { chain_name: StreamingChain.SOLANA_MAINNET, pair_addresses: [ "8EYE7ykjBjFCUcRV3D3tgsd7F2nGUjaCKvSf9Ka8EFWv", "8N5VS5aSyqxrkVL73K9m6hvtkZWmEuBsdkzQL2Mbddy4", ], interval: StreamingInterval.ONE_MINUTE, timeframe: StreamingTimeframe.ONE_HOUR, limit: 100, }, { next: (data) => { console.log("\n Received OHLCV pair data:"); console.log(JSON.stringify(data, null, 2)); }, error: (error) => { console.error("Streaming error:", error); }, complete: () => { console.log("Stream completed"); }, } ); console.log('Monitoring OHLCV data... Press Ctrl+C to stop'); await new Promise(() => {});

After running the code with npx ts-node stream.ts, you’ll receive real-time data similar to the example below.

Key Features and Functionalities

A Solana bot is a tool built to handle one thing exceptionally well – speed. As stated earlier, Solana’s architecture gives you block times of about 400 milliseconds, and when you’re competing for early entries on newly launched tokens, that timing decides whether you buy at $0.0001 or $0.01. What separates a good bot from a bad one is not just its speed but how efficiently it listens, decides, and executes trades. Let’s break down the core features that make a Solana memecoin trading bot work.

Real-Time Market Monitoring

Everything begins with listening to on-chain events. The bot constantly watches the Solana blockchain for events that might signal a trade opportunity, new token mints, liquidity additions on a DEX, changes in pool depth, or unusual transactions from a specific contract.

On Solana, this isn’t done through traditional polling. Polling means you keep asking the blockchain for updates every few milliseconds, which is inefficient and sometimes too late. Instead, most performant bots use streaming APIs (for example, the Goldrush Streaming API) that push real-time data the moment a transaction is confirmed.

This real-time stream includes structured details, like transaction signatures, logs, token mints, and liquidity metrics. The bot filters this data, keeping only the events that match its configured strategy. For instance, it might ignore tokens without liquidity lock information or those launched by unverified accounts. This continuous filtering ensures the bot doesn’t react to noise.

Automated Buy and Sell Execution

Once the bot identifies a valid opportunity, it must act immediately. Manual trading can take 30 to 60 seconds: seeing a post, opening a DEX, connecting a wallet, typing an amount, and confirming a swap. By that time, the price had already multiplied.

A bot removes all manual delay. It constructs a transaction as soon as conditions are met — for example, “buy if liquidity added > 10 SOL and LP locked.” The transaction is signed locally and submitted directly to the blockchain.

Good bots also build in fail-safes. If a transaction fails due to slippage or a front-run, they retry intelligently or skip to the next opportunity. If the price rises too fast, they back off instead of chasing. Sell orders work similarly. The bot can automatically sell when a target ROI or stop-loss is hit. It means you don’t need to stay glued to the screen; the bot exits for you based on predefined logic.

Transaction Management and Prioritization

Solana transactions are cheap, but block space during token launches is limited. When hundreds of bots try to buy at once, the fastest ones are those that use priority fees (small extra payments that push your transaction higher in the queue). Modern trading bots calculate these fees dynamically. If network congestion rises, they slightly increase the priority fee; if it’s calm, they lower it. This keeps costs predictable while improving inclusion chances.

Multi-Wallet Management

Relying on one wallet for all trades is risky. Bots that repeatedly buy from a single address become predictable and easy to track. Advanced bots rotate between multiple wallets to distribute transactions, manage risk, and avoid detection patterns.

A configuration might look like this:

  • Primary wallet: executes main trades.

  • Secondary wallets: handle smaller or test trades.

  • Cold wallet: stores profits securely, isolated from active operations.

How Solana Sniper Bots Work: Technical Overview

Now, let’s look at how it all comes together from a technical standpoint. The design of a Solana memecoin trading bot is an engineering balance between latency, reliability, and safety. Every millisecond and every failed transaction counts. The following sections break down its internal architecture and how each piece fits:

Core Architecture

At a high level, a Solana trading bot sits between data ingestion and transaction execution. Think of it as five moving parts:

  • Data Stream Layer: connects to blockchain event feeds (like Goldrush).

  • Event Filter: parses data to detect relevant tokens or liquidity events.

  • Decision Engine: evaluates whether to trade based on the configured strategy.

  • Transaction Builder: constructs, signs, and sends transactions.

  • Wallet and Security Layer: manages keys, balances, and signatures.

Data Stream and Event Detection

The most critical step is reading Solana data fast. Instead of traditional RPC polling (getSignaturesForAddress or getProgramAccounts), streaming APIs push event data the moment it’s confirmed.

When a liquidity pool is created on, say, pump. fun, the bot receives the event payload immediately. It decodes the logs and extracts:

  • Token mints (for base and quote tokens)

  • LP address and amount of added liquidity

  • Deployer address

Decision Engine

This component defines the brain of the bot. It evaluates incoming events against the user criteria:

  • Is the liquidity above a safe threshold?

  • Has the creator wallet deployed suspicious tokens before?

  • Is the liquidity locked in the pool contract?

If all checks pass, it triggers the transaction builder. The logic is typically simple but deterministic—better to miss a trade than to buy into a rug pull.

Example pseudocode:

if event.type == "liquidity_add" and event.liquidity > 10: if is_liquidity_locked(event.pool): execute_trade(event.baseMint)

Transaction Building and Execution

Building a transaction on Solana involves:

  • Fetching the latest blockhash (to ensure freshness)

  • Creating an instruction (e.g., swap on DEX)

  • Signing with the wallet’s private key

  • Submitting to the cluster via RPC

Execution speed depends on how optimized these steps are. Efficient bots maintain preloaded instructions and recent blockhashes to skip redundant RPC calls. The transaction submission is handled asynchronously, so the bot never blocks while waiting for confirmation.

Benefits of Using a Solana Sniper Bot

In a chain where market events happen in milliseconds, a sniper bot isn’t simply a trading convenience; it’s an infrastructure advantage. Here are the key benefits it brings to anyone building automated strategies on Solana:

  • Latency advantage. The bot reacts to token launches, liquidity additions, and pool creations within a few hundred milliseconds – a window no human can consistently match.

  • Automated precision. Trades execute according to predefined logic, unaffected by emotion or hesitation. This ensures consistent, rule-based decision-making even during volatile launches.

  • Continuous market presence. The bot monitors memecoin and liquidity events 24/7, identifying entry opportunities that usually disappear before most traders even load the chart.

  • Efficient capital deployment. By removing manual oversight, traders can spread small positions across multiple tokens or wallets with minimal effort and cost.

  • Testability and repeatability. Strategy logic can be simulated and validated on Solana Devnet or in dry-run mode before going live, ensuring a safer deployment process.


Risks & Ethical Considerations

Trading on Solana, especially around newly launched tokens is risky. Automating trades with bots raises extra technical, financial, and ethical concerns. Read this before you build or run anything:

  • Market volatility & slippage. Prices move fast. Even correct signals can lose money when liquidity dries up or price moves during your transaction.

  • Failed transactions. Network congestion, reorgs, or hitting gas limits can make transactions fail or revert, sometimes repeatedly and expensively.

  • Rug pulls and malicious tokens. Creators can remove liquidity or abandon projects. Burnt liquidity lowers risk but is not a guarantee.

  • Security (keys & infra). Private keys, signing services, and host machines are single points of catastrophic failure if mishandled.

  • Blacklisting & reputation risk. Protocols and exchanges can block addresses or delist assets if bot activity damages user experience or breaks rules.

Conclusion

Memecoins move fast, and on Solana, speed decides everything. The network’s low fees and short block times make reaction, not prediction, the key advantage. That’s why sniper bots exist, to bridge the small gap between human intent and on-chain execution. What we’ve covered so far lays the groundwork for building one responsibly: how these bots work, the architecture behind them, the essential safeguards that keep automation from turning reckless and how the streaming api works

In the next part, we’ll move from idea to implementation. You’ll see how wallet setup, RPC connections, and streaming APIs come together to detect new meme tokens and trigger trades automatically. By the end, the concept of a “sniper” will stop feeling like hype and start making sense as a precise, rule-driven system. Stay tuned.

Get Started

Get started with GoldRush API in minutes. Sign up for a free API key and start building.

Support

Explore multiple support options! From FAQs for self-help to real-time interactions on Discord.

Contact Sales

Interested in our professional or enterprise plans? Contact our sales team to learn more.