pumpdotfun-sdk icon indicating copy to clipboard operation
pumpdotfun-sdk copied to clipboard

Help integrating listener.ts Pump.fun decoder into Python bot

Open SolBladeDev opened this issue 7 months ago • 1 comments

I’m running a Pump.fun bot in Python and want to track launch events reliably.

I found this listener.ts using pumpdotfun-sdk, which decodes launch events and writes to last_launch.json. It works great.

What’s the cleanest way to connect this with my Python bot? • Should I keep using the .ts listener and read the JSON from Python? • Or is there a simple way to port the decoding logic to Python? • Is there a better setup you’d recommend?

Trying to avoid overcomplicating it. Appreciate any guidance — thanks!

  1. launch_watcher.py import json import time import os

last_seen_tx = None filepath = "last_launch.json"

while True: if os.path.exists(filepath): try: with open(filepath, "r") as f: data = json.load(f) tx = data.get("tx") event = data.get("event", {}) if tx != last_seen_tx: print(f"🚀 New Launch Detected: {event.get('symbol')} - {event.get('name')} ({event.get('mint')})") last_seen_tx = tx except Exception as e: print("Error reading file:", e) time.sleep(5)

  1. README.md
  2. Pump.fun Launch Detector (TS + Python)

This project detects token launches on Pump.fun using a TypeScript listener (listener.ts) that writes to a last_launch.json file.

A simple Python script (launch_watcher.py) watches this file for new launches and prints out launch data. This setup is useful for bridging Solana-based event detection into Python bots.

Files:

  • listener.ts: Listens to Solana logs using pumpdotfun-sdk and saves new launches.
  • launch_watcher.py: Python script that polls for new launches in last_launch.json.
  • user_settings.json: Add your Helius API key and wallets to track.

SolBladeDev avatar May 24 '25 08:05 SolBladeDev

hello guys. i have now an updated version of the sdk.

new: 0.1 MADE A SERVER OUT OF IT which uses localhost 3008 and waits for buy calls 1.0 realtime price tracker which includes stoploss and take profit(SL/TP) sells, the tracked price uses the bought entry price including fees as start price for pricetracker to check the price-difference in % since bought for SL/TP 2.0 trailing stoploss added 3.0 migrationtracker added ( so price gets tracked even after migration from pumpfun->raydium) 3.1 SL/TP and trailing-Stoploss work with migration 4.0 added Raydium buys and sells possibility 5.0 Jito possibility added (uses 0.1% fee for mev protection) 5.1 Snipe enabled via jito, transaction go through in under a second mev proctected 6.0 made the code easy to use, simple functions which are stand alone 7.0 multiple coins trackable at the same time (for me it works with up to 100 tokens at the same time) 8.0 Sell retrys up to 50 times if it doesnt work(for me the highest retry was 3 times in 3 seconds because the was much volume) 9.0 Buy+Sell Slippage for pumpfun or raydium(jupiter) and Jitofee are all customizeable numbers in settings on top of the code (this code uses pumpfun free api so we will never get into ratelimits!)

how to use: -send /buy/tokenadress/solamount ("/buy/xxxxpump/1.0") to localhost 3008 and the bot will snipe into it via jito with mev protection for 0.1% of transaction

  • requires: Helius free membership to track your transactions and you wallet key

i worked on this for several month and now updated it to new pumpfun IDL.

if you want to buy my new version for private use for 5 SOL: Telegram: @Patrick_whale

HakimApo avatar May 25 '25 18:05 HakimApo