Gas Notifier Bot
December 2nd, 2021

During Thanksgiving break, I wanted to ape into a few projects (shoutout Koop and vibes.art) but was reluctant to do anything because of outrageous gas fees. I found myself constantly checking etherscan to see the latest gas prices, which was super annoying. I just wanted to be told once gas hit a reasonable price so that I could make my purchase/whatever I wanted to do).

Although I know you can set a custom gas limit on Etherscan, I am always a little tentative to do this because I don’t want the transaction to fail.

That’s where my gas notifier bot comes in. You set a maximum level that you are comfortable handling a transaction at in Discord, and you will receive a DM once gas dips below that price.

This way, you can find a cool project, set a gas alert, and run the transaction once you get the DM!

Setting an alert in a server
Setting an alert in a server
Alert over DMs
Alert over DMs

How to Use It

Adding the Bot

Use the link below to add the bot to a server (you need admin privileges to do this). The bot requires specific permissions to work, which it will request through the link.

Discord Server

Join the dedicated Gas Alert server! You can learn more about the bot, request new features and help, set alerts, and use any of the commands! Feel free to join the server to use the bot.

Direct Messaging

The bot will message you once the alert is triggered (gas dips below your alert threshold). You can also direct message the bot over Discord to utilize the full functionality.

Commands

The bot is built off of slash commands, which means that their commands can be triggered by a “/’. These can be activated in a server that the bot is in or over DMs.

List of Commands

  • /setalert gas level (set an alert for a specific gas level to receive a DM)
  • /removealert gas level (remove an alert that you sent)
  • /listalerts (see what alerts that you have already set)
  • /gas (see what the current gas price is)

How It Works (behind the Scenes)

Every time a person registers an alert, their username (user object) is inserted in the corresponding gas alert object on MongoDB.

Every 20 seconds, the bot pulls the recommended priority, normal, and slow gas levels from the Etherscan Gas API. It then takes the normal gas level and searches every alert that is less than or equal to that GWEI, then the person will receive a DM from the bot and their name will be removed from the gas alert object. The bot will then update its activity with the current gas price.

Quick Plug

Subscribe to Will Hunter
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from Will Hunter

Skeleton

Skeleton

Skeleton