Letting a bot monitor the marketplace so you don’t have to!
Low liquidity on the NFT marketplace leads to users undercutting each other below the “floor price”.
This makes it especially handy to have a Bot monitoring the market for good discounts.
In this example I’ll be using the Loaded Lions Collection. The bot searches the collection’s marketplace and notifies the user whenever a new listing is posted below floor price.
To start you can clone my Repo from this link.git clone https://github.com/jianminggit/NFT_BOT.git
Your app is now running, but it won’t work because it is missing some environmental variables.
Under the app settings, fill in the following Config_Vars.
BOT_TOKEN: The access code from the telegram bot
Heroku URL: https://<Application Name>.herokuapp.com
Restart the app to let your configurations take effect.
You now have your very own market alert bot!
You can skip this part unless you wish to understand how the bot works.
Let’s start off by using Node.js and Express to build a simple web server.
1.) Web Server
We will be hosting this application on Heroku. To prevent the application from going to sleep on the free tier we do a self-call periodically.
2.) Heroku Free Tier (inactivity sleep workaround)
By making a http request to our own heroku app, we prevent it from sleeping
2.) Telegraf API
Here we will introduce the Telegram Bot. Here we are using Telegraf API. When the user types /start, it stores the chat ID as a subscriber.
3.) Crypto.com NFT API
Crypto.com NFT marketplace does not have any official API but you can monitor the network in your Chrome browser to retrieve it.
Now that we have the API we are going to make a POST request at intervals to look for updates.
4.) Putting it all together
Here we will put the above steps together. Additionally, I have included a JSON file of NFT rarity which can be found in my repository to help the user with decision making.
Congratulations on creating your very own bot!
Repository Link
