Skip to content

SecretDuckSociety/TwitterNFTSalesBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

🦆 Website 🦆 Twitter 🦆 Discord 🦆

TwitterNFTSalesBot

About

Powering the Secret Duck Society Twitter sales bot https://twitter.com/Secretducksales.

The is a javascript implementation for a Twitter Solana NFT collection sales bot. It monitors secondary marketplaces for sales from a given collection and tweets about them. As of now, the bot only monitors Magic Eden and Alpha Art, but functionality for other marketplaces is on the way.

Along with the bot comes a Collection Fetcher that will generate a json file of the metadata from your NFT collection. Here is an example of the format the metadata for each NFT comes in.

    "id": 1968,
    "updateAuthority": "8yvshU8TYtg3c5TwmvJEzRRUgRGZSuWkghv1ZXP9UQUb",
    "mint": "Ezp7t9Mg1yuAu37AV7WAKTVjEGDhmF2beZm31imTdoR4",
    "name": "Duck #1968",
    "uri": "https://arweave.net/jZiFIUvG8cS9nAgiJ34mKxjGmvO8mfdKHsNaD4hEjhA",
    "address": "376bvNdBLagKgqmL7RcWnL3DeCUgk1ND2b4GRnc5NAKj"

The scanner works by monitoring the addresses of secondary marketplaces. It continously uses the function getConfirmedSignaturesForAddress2 to pull a list of the recent transactions for each marketplace address, and then filters these for transactions that are sales involving the desired NFT collection.

If the scanner detects a sale from the collection, it passes the appropriate information to tweet.js to handle Twitter functionality.

Prerequisites

You must download some prerequisite software to be able to run this code:

And set up Twitter Developer Accounts

Installation

git clone https://github.com/SecretDuckSociety/TwitterNFTSalesBot.git
yarn install

How to run the bot

  1. Fill in your .env file with the appropriate values. Note that due to rate limits, if you try to use the public endpoints (https://api.mainnet-beta.solana.com) for RPC_ENDPOINT you will likely be throttled. To use the current iteration of the code you need to use a custom endpoint that doesn't include rate limits.
  2. Visit the constants file and change the NUM_CREATORS variable to match the number of creators for your collection. Your candy machine counts as a creator.
  3. Run node -r dotenv/config CollectionFetcher.js to fetch the metadata associated with your collection.
  4. Run node -r dotenv/config Scanner.js to fire up the bot. It will keep running until the process is killed (ctrl-c). Using tmux to run your bot is recommended. Alternatively, you could run it as a Heroku app (see Heroku Remote).

About

A Twitter bot that will post sales on secondary marketplaces from a given NFT collection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published