DEV Community

Lucas Gragg
Lucas Gragg

Posted on

PumpPortal API tutorial: sniping new launches

I've been working on pump.fun token sniper bot (solana) for a while and wanted to share what I learned.

The problem

Snipe new token launches on Pump.fun. WebSocket-powered detection, instant buy execution, configurable scoring (dev buy size, meme keywords), take-profit/stop-loss, and trailing stops.

What I built

Here are the main features I ended up shipping:

  • Pump.fun WebSocket detection
  • Sub-second buy execution
  • Token scoring algorithm
  • TP/SL/trailing stop
  • Max hold timer
  • Dashboard with live token feed

Code sample

# Basic structure
class Bot:
    def __init__(self, config):
        self.config = config

    def run(self):
        while True:
            self.scan()
            self.execute()
Enter fullscreen mode Exit fullscreen mode

If you want the full working version with all the battle-tested edge cases
handled, I packaged it here: Pump.fun Token Sniper Bot (Solana)

Happy to answer questions about the architecture in the comments.

Top comments (0)