# pumpfun-bonkfun-bot: a Solana meme-coin sniping bot with per-action cookbook scripts

> This Chainstack project is a Python trading bot for pump.fun, letsbonk.fun and StonkFun that watches for token creation, buys and exits on a YAML-configured strategy, with the RPC subscription layer built directly on Solana rather than on a third-party trading API. It suits developers learning Solana transaction mechanics; the README states plainly that the code is not for production.

**chainstacklabs/pumpfun-bonkfun-bot** — A fully functional pump.fun / letsbonk.fun / StonkFun trading and sniping bot not relying on any 3rd party APIs

- Repository: https://github.com/chainstacklabs/pumpfun-bonkfun-bot
- Stars: 1,056 · Forks: 362
- Language: Python
- License: Apache-2.0
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/chainstacklabs-pumpfun-bonkfun-bot

## Four ways to hear about a new token, with different latency and coverage

The bot is built around Solana subscriptions, and the choice of listener is the single most consequential configuration decision. Five YAML files ship in bots/, covering the four listeners plus a StonkFun variant. The geyser listener is the fastest and needs a Geyser endpoint, logs uses logsSubscribe and is supported everywhere, blocks uses blockSubscribe and is not offered by every provider, and shreds is a pre-execution stream that runs ahead of geyser but cannot see router-created coins. The fifth config targets StonkFun over geyser and ships disabled. The coverage is not uniform across platforms either. pump.fun supports all four listeners, while letsbonk.fun and StonkFun support blocks and geyser but neither logs nor shreds, and the README says the bot validates that pairing at startup and refuses to run an invalid one, which saves a lot of silent misconfiguration.

## Extreme fast mode trades price knowledge for submission speed

The trade section carries a flag called extreme_fast_mode that changes what the bot knows before it submits a buy. Normally it reads the curve price and sizes the purchase from that. With the flag enabled it instead buys a fixed token amount, extreme_fast_token_amount, so the buy goes out without a price read. The README is honest about the price of that: you give up knowing what you paid per token. What you get depends on what the listener could decode. When the subscription delivered the coin's CreateEvent, the bot makes no RPC call at all between detecting the token and submitting the buy. When it had to fall back to decoding the create instruction, one account read happens first, because the instruction lacks fields the buy needs. Two knobs tune this: curve_refresh_budget, in seconds with a default of 2.0, caps that read before the bot skips the token, and trust_create_event, default true, when set false forces every listener to do the read and gives up the zero-RPC path.

## Exit strategies and filters decide whether the bot is a scalper or a holder

The trade section holds buy_amount in SOL, a slippage setting and an exit_strategy with three named values, time_based, tp_sl and manual, so the same bot can hold for a fixed window, take profit and stop loss levels, or wait for an operator decision. Priority fees are configured as fixed or dynamic, with the README noting that dynamic pricing costs an extra RPC call, which slows the buy down, a direct tension with the fast modes described earlier. The filters section carries the guardrails: a listener_type, max_token_age, name and creator matching, marry_mode for buying only and never selling, and yolo_mode to trade continuously. Retries set attempt counts and wait windows around creation, the buy and the wait for the next token, and cleanup decides when leftover token accounts are closed, with options disabled, on_fail, after_sell and post_session.

## Quote assets other than SOL need a separate amount table

pump.fun supports quote assets beyond SOL, with USDC named first, and this changes how amounts are expressed. Values are denominated in that mint's own whole units, so a USDC amount of 1.0 is one USDC and is explicitly not comparable to buy_amount, which is in SOL. The configuration carries both, plus a list of allowed quote mints.

```yaml
trade:
  buy_amount: 0.0001    # SOL-paired coins
  quote_amounts:
    usdc: 1.0           # USDC-paired coins

filters:
  allowed_quote_mints: ["sol", "usdc"]   # omit to allow any configured quote
```

Keys accept the aliases sol, wsol and usdc, or a raw base58 mint address. A coin whose quote mint has no configured amount is skipped rather than bought with the wrong figure, which is the kind of default that matters more in a bot than in a web app.

## Setup runs through uv and a YAML file per bot instance

The project needs Python 3.11 or newer and the uv package manager, which the README says will reuse an existing Python install if it is new enough and fetch one otherwise. Installation is three commands after the clone, and the third installs the bot itself as an editable package so the pump_bot entry point becomes available.

```bash
git clone https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
cd pumpfun-bonkfun-bot

uv sync                        # create .venv and install dependencies
source .venv/bin/activate
uv pip install -e .            # install the bot as an editable package
```

Credentials go into a .env copied from .env.example, which lists SOLANA_NODE_RPC_ENDPOINT, SOLANA_NODE_WSS_ENDPOINT, GEYSER_ENDPOINT, GEYSER_API_TOKEN, GEYSER_AUTH_TYPE and SOLANA_PRIVATE_KEY. The README states plainly that public RPC nodes will not work for this workload, and points to its own throughput section for why. Running it takes pump_bot, or uv run src/bot_runner.py, and every bot with enabled true starts, with logs written to logs/{bot_name}_{timestamp}.log.

## The cookbook holds one runnable script per action

The README makes a point of the cookbook/ directory that is worth separating from the bot itself. It holds one standalone script per action, and the README says these are useful on their own even if you never run the bot. For a reader who wants to understand how a pump.fun buy or a launch is actually constructed, that is a much better entry point than reverse-engineering a stateful bot. The wider repository layout supports the same reading style: idl/ for the interface definitions the listeners decode, src/ for the implementation including a geyser/ subdirectory with a proto folder and generated code, tools/, tests/ and docs/. The dev dependency group lists grpcio-tools with a comment saying protoc is only needed to regenerate src/geyser/generated from src/geyser/proto, which tells you the protobuf definitions are checked in rather than generated at install time.

## A learning project, with a scam warning attached to the issue tracker

Two disclaimers frame the whole repository. The README states the code is for learning purposes only, that no responsibility is assumed for the code or its usage, and that it should be modified for the reader's own needs. It also carries a scam alert saying the Issues section is regularly targeted by scam bots that try to redirect people to an external site and drain their funds, and that a GitHub Action tags common patterns with the acknowledgement that the tagging is not 100% accurate, and that deleted comments in issues are scam bots after private keys. The project is published by Chainstack, which sells hosted blockchain infrastructure, and the README points to a full walkthrough on their documentation site while warning that the guide lags behind the code and that the README should be treated as the source of truth for setup and configuration. The licence is Apache-2.0, and the repository publishes no GitHub releases.

## Conclusion

This repository fits developers who want to read and modify working Solana trading code, since the cookbook/ directory exposes one standalone script per action and the YAML configs make the strategy legible without touching the source. It does not fit anyone running it with real funds, because the README labels the code as learning material only and disclaims responsibility, and the throughput demands rule out public RPC endpoints. Verify first that your provider supports the listener your strategy needs, because letsbonk.fun and StonkFun do not support logs or shreds at all, and the bot refuses to start on an invalid platform and listener pairing.

## FAQ

### What Python version does pumpfun-bonkfun-bot require?

Python 3.11 or newer, as stated in the README and confirmed by the requires-python entry in pyproject.toml. The README recommends the uv package manager, which will fetch a suitable Python if the installed one is too old.

### Which listeners can the bot use on letsbonk.fun?

letsbonk.fun supports blocks and geyser, but not logs or shreds. The README states the bot validates the platform and listener pairing at startup and refuses to run an invalid combination.

### What does extreme_fast_mode change about a buy?

Instead of reading the curve price, the bot buys a fixed token amount set by extreme_fast_token_amount, so the buy is submitted sooner but you no longer know what you paid per token. The curve_refresh_budget and trust_create_event settings control how long the price read may take and whether the zero-RPC path is used.

### Which environment variables are required to run the bot?

The .env file needs SOLANA_NODE_RPC_ENDPOINT, SOLANA_NODE_WSS_ENDPOINT, SOLANA_PRIVATE_KEY, and for the geyser and shreds listeners the GEYSER_ENDPOINT, GEYSER_API_TOKEN and GEYSER_AUTH_TYPE values. The README states that public RPC nodes will not work for this workload.

## Sources

- [chainstacklabs/pumpfun-bonkfun-bot on GitHub](https://github.com/chainstacklabs/pumpfun-bonkfun-bot)
- [Issues](https://github.com/chainstacklabs/pumpfun-bonkfun-bot/issues)
- [License: Apache-2.0](https://github.com/chainstacklabs/pumpfun-bonkfun-bot/blob/main/LICENSE)
- [README](https://github.com/chainstacklabs/pumpfun-bonkfun-bot/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/chainstacklabs-pumpfun-bonkfun-bot
