1fge / pump-fun-sniper-bot

87 stars 30 forks source link

Pump-Fun Sniper Bot

This repository contains the codebase for the Pump-Fun Sniper Bot developed by @licketyspliket and me. Although this project is archived and not intended for further iteration, this README provides a comprehensive overview to help anyone who may want to understand or run the bot.

Overview

The Pump-Fun Sniper Bot is designed to interact with the Solana blockchain, purchasing newly minted coins and managing them, based on our replication of orcACR...'s strategy. I detail the strategy more in my first blog post on this project, which can be found here.

Bot Startup

Configuration

Environment Variables

Main Configuration

The main configuration values for the bot are located in main.go and can be edited as needed.

Bot Instantiation

The bot is instantiated with the following parameters:

// Purchase coins with 0.05 Solana, priority fee of 200000 microlamports
bot, err := NewBot(rpcURL, wsURL, privateKey, db, 0.05, 200000)
if err != nil {
    log.Fatal(err)
}

Jito Integration

To remove Jito integration, comment out the following block:

if err := bot.beginJito(); err != nil {
    log.Fatal("Error Starting Jito", err)
}

Installation and Running the Bot

  1. Clone the Repository:

    git clone https://github.com/1fge/pump-fun-sniper-bot.git
    cd pump-fun-sniper-bot
  2. Install Dependencies: Ensure you have Go installed. Then, run:

    go mod tidy
  3. Set Environment Variables: Ensure PRIVATE_KEY is set in your environment.

  4. Edit Configuration: Modify the RPC URLs, WebSocket URLs, and MySQL database credentials in main.go as needed.

  5. Run the Bot:

    go run .

Additional Information

Acknowledgements

A special thank you to Gagliardetto for creating the open-source Solana Go packages that were instrumental in developing this bot. The code we used and built on from him can be found in the pkg/jito-go directory, as well as the output from his anchor-go package based on the Pump.fun IDL, which is found in the pump directory.

Also, a huge thank you to weeaa for their work on Jito Go SDK, which we used to handle all interactions with Jito.

Learn More

Read more about the development of this project on my blog.