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.

Overview

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.

Implementation details

How the pump.fun bot uses Geyser

1

Subscription — a single SubscribeRequest is sent with a transaction filter that contains the pump.fun program ID, commitment level, transaction status.

2

Parsing — every incoming SubscribeUpdate.transaction is checked for the 8‑byte discriminator of the Create instruction.

3

TokenInfo emission — when found, GeyserEventProcessor constructs a TokenInfo dataclass (name, symbol, mint, curves, user) and hands it to the existing buyer / seller pipeline.

4

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.

Configuration changes

To switch to Geyser in the pump.fun V2 repo:

  1. Set LISTENER_TYPE="geyser" in src/config.py
  2. Add the following to your .env file:
    • GEYSER_ENDPOINT
    • GEYSER_API_TOKEN

Benchmarking listeners

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.

About author

3nNn0T2p_400x400

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 Subgraphs.