> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Solana: Listening to pump.fun token mint using Geyser

> Stream pump.fun token mint events in real time using Geyser and Yellowstone gRPC on a Chainstack Solana node for low-latency token launch detection.

## 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](https://github.com/chainstacklabs/pump-fun-bot/tree/refactored/main-v2), 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](ref:blocksubscribe-solana) extra RPC calls like [getTransaction](ref: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`

<Signup />

## Benchmarking listeners

Run the benchmark script for five minutes (or any duration you like):

```bash theme={"system"}
# 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.

## Related guides

* [Solana: Creating a trading and sniping pump.fun bot](/docs/solana-creating-a-pumpfun-bot)
* [Solana: Listening to pump.fun migrations to Raydium](/docs/solana-listening-to-pumpfun-migrations-to-raydium)

### About author

<CardGroup>
  <Card title="Anton Sauchyk">
    <img src="https://mintcdn.com/chainstack/UN3rP7zhB69idvnC/images/docs/profile_images/1817926677730664448/3nNn0T2p_400x400.jpg?fit=max&auto=format&n=UN3rP7zhB69idvnC&q=85&s=1d13d3584862f1be3a84fa3f8e38fea7" alt="Anton Sauchyk" style={{width: '80px', height: '80px', borderRadius: '50%', objectFit: 'cover', display: 'block', margin: '0 auto'}} noZoom width="400" height="400" data-path="images/docs/profile_images/1817926677730664448/3nNn0T2p_400x400.jpg" />

    <Icon icon="code" iconType="solid" /> Developer Advocate @ Chainstack
    <br /><Icon icon="laptop" iconType="solid" /> Multiple years of software development and Web3 expertise

    <div style={{display: "flex", justifyContent: "center", gap: "12px"}}>
      <a href="https://github.com/smypmsa" style={{textDecoration: "none", borderBottom: "none"}}>
        <Icon icon="github" iconType="brands" />
      </a>

      <a href="https://x.com/sensuniama" style={{textDecoration: "none", borderBottom: "none"}}>
        <Icon icon="twitter" iconType="brands" />
      </a>

      <a href="https://www.linkedin.com/in/anton-sauchyk/" style={{textDecoration: "none", borderBottom: "none"}}>
        <Icon icon="linkedin" iconType="brands" />
      </a>
    </div>
  </Card>
</CardGroup>
