Overview
This guide shows you how to listen for pump.fun token creation events in real time using Geyser. In the pumpfun-bonkfun-bot repository, there is thecookbook/pumpfun/listen/pumpfun_listen_tokens_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.
Implementation details
How the pump.fun bot uses Geyser
- Subscription — a single
SubscribeRequestis sent with a transaction filter that contains the pump.fun program ID, commitment level, transaction status. - Parsing — every incoming
SubscribeUpdate.transactionis checked for the 8‑byte discriminator of the Create instruction. - TokenInfo emission — when found, the platform event parser (
PumpFunEventParserfor pump.fun) constructs aTokenInfodataclass (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.
Configuration changes
To switch the bot to Geyser:- Set
listener_type: "geyser"underfiltersin your bot’s.yamlconfig in thebots/directory. Thebots/bot-sniper-1-geyser.yamltemplate has it set already. - Add the following to your
.envfile:GEYSER_ENDPOINT— the gRPC endpoint from Access and credentials > Yellowstone gRPC in host-and-port form, asyellowstone-solana-mainnet.core.chainstack.com:443. The bot uses the Pythongrpcpackage, which takes the host and port with no scheme, so drop anyhttps://prefix and add:443if the console omits itGEYSER_API_TOKEN— the x-token from the same tab
Benchmarking listeners
Run the benchmark script. It runs for the number of seconds set inTEST_DURATION at the top of tools/compare_listeners.py:
blockSubscribe, logsSubscribe, Geyser, and PumpPortal) 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 your bot’s .yaml config. All higher‑level trading code remains untouched, yet you gain a tangible latency advantage when sniping newly created pump.fun tokens.
Related guides
- Solana: Creating a trading and sniping pump.fun bot
- Solana: Listening to pump.fun migrations to PumpSwap
