Solana: Listening to pump.fun token mint using Geyser
TLDR
- Geyser streams Solana transactions over gRPC, reaching your code sooner than
logsSubscribe
orblockSubscribe
. - In the pump.fun V2 repo you can switch to it by:
- setting
LISTENER_TYPE="geyser"
insrc/config.py
and - adding
GEYSER_ENDPOINT
+GEYSER_API_TOKEN
to your .env file.
- setting
- Nothing else in the buyer / seller logic changes; the existing
GeyserListener
feeds the sameTokenInfo
objects to the trading loop. - The test script
tests/compare_listeners.py
lets you benchmark Geyser against the other two listeners on your own node.
Main article
V2 of the pump.fun bot
V2 of the pump.fun bot is in active development based on your feedback. It's an improved and usable version right from the start.
Use the refactored/main-v2 branch. And feel free to provide feedback through Issues.
This guide shows you how to listen for pump.fun token creation events in real time using Geyser.
In the pump-fun-bot repository, there is the learning-examples/listen_create_from_geyser.py
script. It demonstrates how to capture the new token’s name, symbol, mint address, user (creator), bonding curve address, and associated bonding curve address—no methods like blockSubscribe extra RPC calls like getTransaction are required.
The listener in this repo subscribes to successful transactions that include the pump.fun program and parses only the “Create” instruction (checking the first 8 bytes of instruction data), decoding it to TokenInfo
in micro‑seconds.
How the pump.fun bot uses Geyser
- Subscription – a single
SubscribeRequest
is sent with a transaction filter that contains the pump.fun program ID, commitment level, transaction status. - Parsing – every incoming
SubscribeUpdate.transaction
is checked for the 8‑byte discriminator of the Create instruction. - TokenInfo emission – when found,
GeyserEventProcessor
constructs aTokenInfo
dataclass (name, symbol, mint, curves, user) and hands it to the existing buyer / seller pipeline. - Trading flow – buy, hold, sell, and optional account cleanup happen exactly as with the WebSocket listeners. No other files need modification.
The only operational difference is that tokens enter the queue earlier, giving the bot a cheaper entry price.
Get you own node endpoint today
Start for free and get your app to production levels immediately. No credit card required.
You can sign up with your GitHub, X, Google, or Microsoft account.
Comparing listeners in your own environment
Run the benchmark script for five minutes (or any duration you like):
# duration in seconds
python tests/compare_listeners.py 300
It launches all available types of listeners (BlockListener, LogsListener and GeyserListener) and records all detected mints. The results of the script are tables with statistics on how many and with which latency mints have been detected by each listener. The absolute numbers depend on your provider and network path, but Geyser is consistently the front‑runner.
Summary
Switching to the Geyser listener is a two‑step change—update .env
and set LISTENER_TYPE="geyser"
in config.py
. All higher‑level trading code remains untouched, yet you gain a tangible latency advantage when sniping newly created pump.fun tokens.
See also:
- Solana: Creating a trading and sniping pump.fun bot
- Solana: Listening to pump.fun migrations to Raydium
About author
![]() |
Anton Sauchyk🥑 Developer Advocate @ Chainstack💻 Multiple years of software development and Web3 expertise. Creator of the open-source Compare Dashboard for RPC provider performance benchmarking. Core contributor to the DevEx team’s pump.fun trading bot. Author of technical tutorials on EVM blockchains, Solana, TON and Elastic Subgraphs. |
Updated 2 days ago