Skip to content

blazkronX/Pumpfun-AI-Comment-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Pump.fun AI Comment Bot

An intelligent automated comment bot for Pump.fun on the Solana blockchain. Generate AI-powered comments or use manual inputs to engage with tokens on the platform.

TypeScript Solana OpenAI


πŸ“‹ Table of Contents


✨ Features

  • 🧠 AI-Powered Comments - Generate engaging comments using OpenAI GPT-4 Mini
  • ✍️ Manual Input - Add custom comments manually
  • πŸ” Wallet Support - Use new wallets or existing Solana wallets
  • 🌐 Proxy Rotation - Built-in proxy support with automatic rotation for reliability
  • ⏱️ Configurable Intervals - Set custom delay intervals between comments
  • πŸ”„ Automatic Retry - Proxy failover mechanism for uninterrupted operation
  • πŸ“Š Comment Management - View and manage your comment library
  • 🎯 User Agent Rotation - Randomized user agents to avoid detection
  • πŸ’¬ Interactive CLI - Easy-to-use command-line interface

πŸ”§ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v16.x or higher)
  • npm or yarn
  • TypeScript (included in dependencies)
  • OpenAI API Key - Get one here
  • Solana Wallet (optional - bot can generate new ones)

πŸ“¦ Installation

  1. Install dependencies

    npm install
    # or
    yarn install
  2. Create environment file

    cp .env.example .env

βš™οΈ Configuration

Create a .env file in the root directory with the following variables:

# OpenAI Configuration
OPENAI_KEY=your_openai_api_key_here

# Token Configuration
PUMP_MINT=token_mint_address_here

# Bot Wallet (optional - can use new wallet instead)
BOT_KEY=your_solana_wallet_private_key_base58

# Comment Interval Configuration (in milliseconds)
COMMENT_MIN_INTERVAL=1000
COMMENT_MAX_INTERVAL=4000

Configuration Parameters

Parameter Description Default Required
OPENAI_KEY Your OpenAI API key for AI comment generation - Yes
PUMP_MINT The token mint address on Pump.fun - Yes
BOT_KEY Base58 encoded private key of your Solana wallet - No*
COMMENT_MIN_INTERVAL Minimum delay between comments (ms) 1000 No
COMMENT_MAX_INTERVAL Maximum delay between comments (ms) 4000 No

*Only required if using existing wallet mode

Proxy Configuration

Create a proxy_list.json file in the root directory:

[
  {
    "protocols": "http",
    "ip": "proxy_ip_address",
    "port": "proxy_port"
  },
  {
    "protocols": "https",
    "ip": "another_proxy_ip",
    "port": "another_proxy_port"
  }
]

πŸš€ Usage

Starting the Bot

npm run dev
# or
yarn dev

Main Menu Options

Once started, you'll see an interactive menu with the following options:

[Main Menu]

  [1] Generate AI Comments
  [2] Get Comment List
  [3] Run Comment Bot
  [4] About Pumpfun Comment Bot
  [5] Exit

1. Generate AI Comments

Generate comments using AI or add them manually:

AI Generation

  • Select "Generate Comment with AI"
  • Enter a key sentence or context about the token
  • The bot will use OpenAI GPT-4 Mini to generate relevant comments
  • Comments are automatically saved to data.json

Example prompt:

"Innovative DeFi token with staking rewards and governance features. Official site: example.com"

Manual Input

  • Select "Input Comment Manually"
  • Type your comment
  • Comment is saved to data.json

2. Get Comment List

View all stored comments in your library with their index numbers.

3. Run Comment Bot

Choose between two modes:

New Wallet Mode

  • Bot generates a new Solana wallet for each comment
  • No prior wallet setup required
  • Provides better anonymity

Existing Wallet Mode

  • Uses the wallet configured in .env (BOT_KEY)
  • Maintains consistent identity
  • Requires pre-configured wallet

Operation:

  • Bot randomly selects comments from your library
  • Posts comments at random intervals (within configured range)
  • Uses proxy rotation for each request
  • Press 0 and Enter to stop the bot

πŸ“ Project Structure

Pumpfun_AI_Trading_Bot/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ commands/          # CLI menu commands
β”‚   β”‚   β”œβ”€β”€ index.ts       # Menu exports
β”‚   β”‚   └── clis.ts        # Command definitions
β”‚   β”œβ”€β”€ funcs/             # Core functionality
β”‚   β”‚   └── index.ts       # AI generation, comment posting
β”‚   β”œβ”€β”€ bot.ts             # Bot authentication and posting logic
β”‚   β”œβ”€β”€ config.ts          # Environment configuration
β”‚   β”œβ”€β”€ constants.ts       # Constants and strings
β”‚   β”œβ”€β”€ index.ts           # Entry point
β”‚   β”œβ”€β”€ types.ts           # TypeScript type definitions
β”‚   β”œβ”€β”€ utils.ts           # Utility functions
β”‚   └── test.ts            # Testing utilities
β”œβ”€β”€ data.json              # Comment storage
β”œβ”€β”€ proxy_list.json        # Proxy configuration
β”œβ”€β”€ package.json           # Dependencies and scripts
β”œβ”€β”€ tsconfig.json          # TypeScript configuration
β”œβ”€β”€ .env                   # Environment variables
β”œβ”€β”€ .gitignore            # Git ignore rules
└── README.md             # Documentation

πŸ” How It Works

Authentication Flow

  1. Wallet Authentication

    • Bot signs a message with wallet's private key
    • Timestamp-based signature ensures freshness
    • Signature is verified before sending
  2. Login Process

    • POST request to Pump.fun's authentication endpoint
    • Returns authentication token (cookie)
  3. Token Generation

    • Retrieves comment thread token using auth cookie
    • Token required for posting comments

Comment Posting

  1. Random Selection

    • Bot randomly selects a comment from your library
  2. Proxy Rotation

    • Randomly selects an unused proxy
    • Falls back to next proxy on failure
    • Rotates through all available proxies
  3. User Agent Randomization

    • Randomly selects from 10+ user agent strings
    • Simulates different browsers and devices
  4. Post Request

    • Comment posted via Pump.fun's client proxy
    • Includes authentication token in headers
    • 10-second timeout per request
  5. Delay

    • Random delay between MIN and MAX intervals
    • Prevents rate limiting and detection

πŸ”’ Security

Important Notes

⚠️ Disclaimer: This bot is for educational purposes. Use responsibly and in accordance with Pump.fun's terms of service.

⚠️ Private Keys: Never share your BOT_KEY or commit it to public repositories.

⚠️ Rate Limiting: Respect platform rate limits to avoid account restrictions.


πŸ› οΈ Development

Run Tests

npm run test
# or
yarn test

Build TypeScript

TypeScript is executed directly via ts-node. No build step required for development.


🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ™ Acknowledgments


πŸ“Š Stats

  • Language: TypeScript
  • Blockchain: Solana
  • AI Model: GPT-4 Mini
  • Version: 1.0.0

Made with ❀️ for the Solana Community

⭐ Star this repo if you find it helpful!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published