$ show chainstacklabs/pumpfun-bonkfun-bot
This is a multi-platform Solana trading bot designed for sniping newly created tokens on pump.fun and letsbonk.fun (Raydium LaunchLab). It listens for token creation events in real-time via multiple mechanisms (gRPC Geyser, WebSocket logs/block subscription, third-party PumpPortal feed), then automatically executes buy and sell trades using program instructions (v2 with full account lists). The codebase emphasizes a platform-agnostic architecture with abstract interfaces for address derivation, instruction building, event parsing, and curve management, allowing new platforms to be added without altering core trading logic. It includes optional 'extreme fast mode' for zero-RPC buys, configurable exit strategies (take-profit, stop-loss, time-based), priority fee management (fixed or dynamic), compute unit optimization, and an interactive cleanup manager. The repository is explicitly educational ('NOT FOR PRODUCTION') and ships with an extensive suite of standalone learning examples and verification scripts that offline-test edge cases such as v1/v2 transaction cutover, optional trailing arguments, price feed failures, and retry bounding. Despite its purpose as a demonstration, the code demonstrates solid engineering practices: abstraction layers, configuration-driven bots, a token bucket rate limiter, plugin-based fee engines, and generic Anchor IDL decoders.
The LLM identified 5 files worth highlighting for reuse:
Plugable priority fee manager that composes a fixed fee and a dynamic fee (based on getRecentPrioritizationFees). The abstract base class (src/core/priority_fee/__init__.py) defines the contract, and the manager selects the best fee from registered plugins. Clean separation of concerns; extractable for any Solana transaction builder.
Generic Anchor IDL decoder that parses instruction data, account state, and events into Python dictionaries. Handles discriminators, trailing optional arguments, and nested types. Used by all platform modules for protocol decoding. Can be reused for any Anchor program without modification.
Async-safe token bucket rate limiter with configurable burst capacity and refill rate. Enforces max requests per second without blocking the event loop. Lightweight, self-contained, and easily adapted for any rate-limited API.
Factory that creates the appropriate token listener (geyser gRPC, logsSubscribe, blockSubscribe, or PumpPortal) based on configuration. Encapsulates listener setup and wiring, isolating the rest of the bot from listener-specific details. Demonstrates clean separation and testability.
Defines abstract interfaces (AddressProvider, InstructionBuilder, CurveManager, EventParser) for platform-specific implementations. Creates a clean contract that enables plug-and-play support for new trading platforms. The pattern is reusable for any system that needs to support multiple backends with identical operational flows.