Solana Discord Wallet Tracker

Requirements

I recommend the latest version of Node or at least v16+ as the latest Discord.js version can have issues with older Node versions.

A dedicated machine to run the bot on.

I recommend using an Ubuntu 22.04 VPS from Vultr, I use these to host bots and even the cheapest Cloud Compute ($6 per month) is more than enough.

I also recommend using a Process Manager such as PM2, this bot supports its usage and will kill the bot's process to let the manager restart it to keep values refreshed and rate limits properly distributed

Initial Setup

First you will need to install the Node.js modules used in this script

npm i @solana/web3.js @metaplex/js axios fs discord.js@13.0.0 @discordjs/rest discord-api-types @discordjs/builders @solana/spl-token-registry

You will have a file called config.json. In the file, change the first 3 values with your values, instructions are below or you can follow the YouTube video guide for a quick and easy setup.

{
  "token": "DiscordBotTokenHere",
  "clientId": "DiscordAppClientIdHere",
  "guildId": "YourDiscordsGuildIdHere",
  "buysale": true,
  "listingChanges": true,
  "mints": false,
  "transactions": true,
  "rpcEndpoint": "https://solana-api.projectserum.com",
  "requestsPerMin": 130,
  "minimumSol": 1,
  "pm2": false
}

You will need to enable Developer Mode in Discord to get your guildId

Open up https://discord.com/developers/applications and create an App for Discord, from the OAuth2 page for it, copy/paste the Client ID into the config.json file. Then on the Bot page for your App, create a bot and copy/paste the Token for it into the config.json. Last thing on the developer page is to go to OAuth2 > URL Generator select the boxes for bot and applications.commands then for Permissions tick the Send Messages, Embed Links and Read Messages/View Channels then copy the generated URL, paste into your browser and invite the new Bot to your server.

In Discord, after enabling Developer Mode, right click on your Server's icon and click on Copy ID and paste that into config.json for guildId.

buysale, listingChanges, mints & transactions are the types of updates the bot will post, if you want them keep them as true, if you don't wish to receive certain ones, change to false.

rpcEndpoint by default is Project Serum's RPC Endpoint but is rate limited, you can change this to your own RPC Node Endpoints if required.

requestsPerMin is the maximum requests you endpoint will allow per minute, the Public endpoint is 200ish but I suggest 130-140 to avoid getting IP limited and to allow some wiggle room. These requests are evenly split up between each wallet.

minimumSol is for the Transactions tracking and is the minimum amount you wish to receive updates for.

pm2 is a new addition and used in the case that you are using the PM2 process manager that will auto restart the bot in the case of any errors, at certain parts when wallets are added / removed and settings changed, if using pm2 it will kill the bot process and restart to use latest settings.

After all this, in the console run node deploy-commands.js this will add the bot's / commands to your server.

How To Use

Simply type node botcontrol.js into your console and it'll start the main script which will in turn start the tracker script. The tracker script when started will use the list of wallets from wallets.json to track.

In order to add wallets to the list, create a new channel in your Discord that you are wanting the updates for a wallet posted to add use the command /addwallet walletaddresshere walletname walletchannel walleticonURL

It will add the wallet to the tracker, set the supplied channel for it to update in and set a name and image for it to have on the embedded messages, a URL is needed for images but you do not have to supply one.

If you wish to remove a wallet from the tracker simply go into the channel that its posting in and use /removewallet walletaddresshere and it will remove the details from the wallets.json.

If you wish to not receive updates for certain activites you can turn them on/off with their respective commands and using a True or False value;

/watchbuysale (Buy / Sale Market transactions)
/watchlistings (Market listings changes)
/watchmints (NFT Minting Transactions)
/watchtransactions (Solana and SPL Token transfers)

You can also now use your own Solana RPC Endpoints from services like QuickNode to enable you to decrease a request interval and also increase the wallets you can watch at once without being rate limited by the Public endpoints, you can change it by using /setendpoint and entering your RPC Endpoint URL.

If it doesn't look like the tracker is working, you can always use /restartbot to have it restart the tracker script without the need to restart the botcontrol.js script from the console when not necessary.

Features

  • Get Marketplace Buy / Sell transactions

  • Get Marketplace listing change transactions

  • Get NFT mint transactions (experimental & set to false by default)

  • Get Solana and SPL Token transfers

  • Check and Change your config with Discord commands

  • Now includes changes to utilize PM2 Process Manager

Last updated