Skip to content

Discord bot for tracking Solana wallet activity, focusing on detecting "sniper" wallets that buy tokens early. Built with Discord.js and Solana Web3.js.

Notifications You must be signed in to change notification settings

vladmeer/discord-wallet-track-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

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

Repository files navigation

Solana Wallet Tracking Bot

A professional Discord bot for tracking Solana wallet activity and detecting "sniper" wallets that attempt to buy tokens early. This bot monitors wallet transactions in real-time and provides notifications when tracked wallets perform swaps.

πŸš€ Features

  • Real-time Wallet Tracking: Monitor specific Solana wallet addresses for swap activity
  • Sniper Detection: Automatically detect wallets attempting to buy tokens before liquidity pools are created
  • Token Analysis: Fetch token metadata, price data, and liquidity information from DexScreener
  • Discord Integration: Receive instant notifications via Discord DMs when tracked wallets make transactions
  • Market Monitoring: Track new OpenBook market creation and identify early buyers

πŸ“‹ Prerequisites

  • Node.js 16.x or higher
  • npm or yarn package manager
  • Discord Bot Token and Application ID
  • Solana RPC endpoint (recommended: Helius, QuickNode, or Alchemy for better performance)

πŸ› οΈ Installation

  1. Clone the repository

    git clone <repository-url>
    cd Solana-wallet-track-bot
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Set up environment variables

    Copy the example environment file and fill in your values:

    cp env.example .env

    Then edit the .env file with your actual credentials:

    # Discord Bot Configuration
    BOTTOKEN=your_discord_bot_token_here
    APP_ID=your_discord_application_id_here
    USER_ID=your_discord_user_id_here
    
    # Solana RPC Configuration
    # Use a reliable RPC provider like Helius, QuickNode, or Alchemy
    # Format: https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY
    # Or: https://api.mainnet-beta.solana.com (public, rate-limited)
    RPC_URL=https://api.mainnet-beta.solana.com
  4. Get Discord Bot Credentials

    • Go to Discord Developer Portal
    • Create a new application
    • Navigate to "Bot" section and create a bot
    • Copy the bot token to BOTTOKEN
    • Copy the Application ID to APP_ID
    • Enable "Message Content Intent" in the Bot settings
    • Get your Discord User ID (enable Developer Mode in Discord, right-click your profile, "Copy ID")
  5. Set up Solana RPC

    • For production use, get an API key from Helius, QuickNode, or Alchemy
    • Free tier RPC endpoints are rate-limited and may cause issues with real-time monitoring

πŸš€ Usage

  1. Start the bot

    npm start
    # or
    node index.js
  2. Invite the bot to your Discord server

    • Use this OAuth2 URL (replace YOUR_APP_ID):
    https://discord.com/api/oauth2/authorize?client_id=YOUR_APP_ID&permissions=2048&scope=bot%20applications.commands
    
  3. Use slash commands in Discord

πŸ“– Commands

/track <address>

Track a specific Solana wallet address for swap activity. The bot will send you a DM notification whenever the tracked wallet performs a swap.

Parameters:

  • address (string, required): The Solana wallet address to track

Example:

/track 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU

/ispy

Start monitoring for new OpenBook markets and automatically detect sniper wallets that attempt to buy tokens within 10 seconds of market creation.

Note: This command starts a continuous listener. Use /removeispy to stop it.

/removeispy

Stop the sniper detection listener that was started with /ispy.

/scan <mint>

Scan a token mint address to find wallets that attempted to buy the token before the liquidity pool was created (failed transactions).

Parameters:

  • mint (string, required): The token mint address to scan

Example:

/scan EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

/close-track

Close the active wallet tracking session started with /track.

πŸ”§ Configuration

Environment Variables

Variable Description Required
BOTTOKEN Discord bot token Yes
APP_ID Discord application ID Yes
USER_ID Your Discord user ID for receiving DMs Yes
RPC_URL Solana RPC endpoint URL Yes

RPC Endpoint Recommendations

  • Helius: https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY
  • QuickNode: https://YOUR_ENDPOINT.solana-mainnet.quiknode.pro/YOUR_API_KEY/
  • Alchemy: https://solana-mainnet.g.alchemy.com/v2/YOUR_API_KEY
  • Public (Free): https://api.mainnet-beta.solana.com (rate-limited, not recommended for production)

πŸ—οΈ Project Structure

Solana-wallet-track-bot/
β”œβ”€β”€ commands/           # Discord slash commands
β”‚   β”œβ”€β”€ track.js       # Track wallet command
β”‚   β”œβ”€β”€ ispy.js        # Start sniper detection
β”‚   β”œβ”€β”€ removeispy.js  # Stop sniper detection
β”‚   β”œβ”€β”€ scan.js        # Scan token for snipers
β”‚   └── close-track.js # Close tracking session
β”œβ”€β”€ utiles/            # Utility functions
β”‚   β”œβ”€β”€ index.js       # Core utilities (tracking, token info, etc.)
β”‚   β”œβ”€β”€ getisniper.js  # Real-time sniper detection
β”‚   β”œβ”€β”€ getMarkets.js  # Market monitoring
β”‚   └── getCreator.js  # LP token analysis
β”œβ”€β”€ index.js           # Main bot entry point
β”œβ”€β”€ package.json       # Dependencies and scripts
└── README.md          # This file

πŸ” How It Works

Wallet Tracking (/track)

  1. Sets up a WebSocket listener on the Solana network for the specified wallet
  2. Monitors transaction logs in real-time
  3. Parses swap transactions to extract SOL amounts and token mints
  4. Sends Discord DM notifications when swaps are detected
  5. Implements rate limiting (5-minute cooldown between notifications)

Sniper Detection (/ispy)

  1. Monitors OpenBook market creation events
  2. Tracks quote vault activity within 10 seconds of market creation
  3. Identifies wallets that attempt to buy before liquidity is available
  4. Reports snipers with their wallet addresses, buy amounts, and transaction fees

Token Scanning (/scan)

  1. Fetches market information for a given token mint
  2. Analyzes failed transactions on the market before pool creation
  3. Extracts wallet addresses and SOL amounts from failed buy attempts
  4. Categorizes snipers by SOL balance ranges

⚠️ Important Notes

  • Rate Limiting: The bot implements a 5-minute cooldown between notifications for the same wallet to prevent spam
  • RPC Limits: Free RPC endpoints have rate limits. For production use, get a paid RPC provider
  • WebSocket Connections: The bot maintains WebSocket connections to Solana. Ensure your server has stable internet connectivity
  • Error Handling: The bot includes comprehensive error handling, but network issues may cause temporary disconnections

πŸ› Troubleshooting

Bot doesn't respond to commands

  • Check that the bot token is correct in .env
  • Verify the bot has been invited with proper permissions
  • Ensure the bot is online in your Discord server
  • Check console logs for error messages

No notifications received

  • Verify USER_ID is set correctly in .env
  • Check that DMs are enabled between you and the bot
  • Ensure the tracked wallet address is valid
  • Check RPC endpoint connectivity

RPC errors

  • Verify your RPC URL is correct
  • Check if you've exceeded rate limits (if using free tier)
  • Consider upgrading to a paid RPC provider
  • Check network connectivity

πŸ“ License

This project is provided as-is for educational and research purposes.

🀝 Contributing

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

⚠️ Disclaimer

This bot is for educational purposes only. Use at your own risk. The authors are not responsible for any financial losses or damages resulting from the use of this software.

πŸ“ž Support

For issues, questions, or contributions, please open an issue on the GitHub repository.


Made with ❀️ for the Solana community

About

Discord bot for tracking Solana wallet activity, focusing on detecting "sniper" wallets that buy tokens early. Built with Discord.js and Solana Web3.js.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published