An app to keep a watch on big volume trades of cryptocurrecies on different exchanges by sending alerts via a Telegram Bot.
Last updated Jul 8, 2026
193
Stars
113
Forks
11
Issues
0
Stars/day
Attention Score
66
Topics
Language breakdown
No language data available.
▸ Files
click to expand
README
Crypto Whale Watcher
A Note About Exchange APIs
You might notice I haven't used any of the exchanges' respective node modules in this project, and have instead gone with the raw REST APIs. This is because I did not realize these modules existed until much later into the development process. Therefore, I understand that my API calls might come with manual need for stream management. But I feel going through the documentations of these modules, then rewriting the code would cause a significant waste of time and resources until I am made to realize otherwise.Table of Contents
+ Currency Pairs + Limits + AlertsBasic Setup
- [Fork][] and [Clone][] the repository
- [Create a Telegram Bot][] using BotFather, note down the authorization-token.
- Create a group or channel, and add the bot to it. Then [get the group/channel's chat_id][].
- Create a PostgreSQL database.
Installation
Creating Database
- Create a file with name ".env" in the parent directory.
- Add the auth-token, respective chat_id(s), and database url to the ".env" file as key-value pairs in the form shown below. These key-value pairs will be exported to the environment variables.
BOT_TOKEN=Your:<your-bot-token>
CHAT_ID=<main-chat-id>
TESTCHATID=<test-chat-id>
DATABASE_URL=postgres://<username>@localhost:5432/<db-name>
+ On a *nix OS, steps 5 and 6 can be combined by typing the following lines in sequence in the terminal:
touch .env
echo "BOT_TOKEN=<your-bot-token>" >> .env
echo "CHAT_ID=<main-chat-id>" >> .env
echo "TESTCHATID=<test-chat-id>" >> .env
echo "DATABASE_URL=$USER@localhost:5432/<db-name>" >> .env
+ There is another optional environment variable for directing alerts to a test chat for development and testing purposes. If you want to do so, add the following on a new line to the ".env" file: TESTING=true
- Run
npm install, and run the app vianpm run start.
- If you get Database errors, try running
npm run db:migrate. IMPORTANT: This command deletes and recreates all tables. You will need to run this every time you make a change in the list of currencies in the config file.
- A lot of the major hosting services come preinstalled with PostgreSQL or provide some plugin. Therefore the steps for creating and setting up the database may differ. For example, Heroku has an excellend PostgreSQL plugin which upon installation automatically adds the environment variable for the database URL.
- On your local machine, the app will be served on port 3000 of localhost.
Customizing
The app is made to use certain limits and services that may or may not be suitable for others. Therefore it is possible to make changes and customize the app to better suit the developers requirements. Please do not send pull requests to the main repository with these changes.Currency Pairs
Currency pairs are defined in the [config.js][] file, and can easily be added and removed as needed. One needs to be mindful to try and add pairs that are supported by both Binance and Bitfinex. Not doing so can cause unexpected behavior.Limits
The alerts are triggered by checking the various limits for the crypto-currency. You can learn about each limit in the [wiki][] section of this project. Limit changes are persistent and are saved to the PostgreSQL databse on the running machine. Limits can easily be changed without affecting the repository through the browser by going to the endpoint of the running app. If you are running the app on your local machine, it'll be served on localhost:3000. Limits can also be changed by editing the migration file, and runningnpm run db:migrate, in which case changes will be saved on the repository level. This method is not recommended if you plan to contribute to the main repository.
Alerts
The app currently uses Telegram as the medium for alerts. However, if one requires they can choose to add and/or replace it with other services like Discord. It is recommended you keep the structure of the functions the same. The alerts are managed in message.js.Screenshots
Telegram :
Webpage :
Contributing
If you are a developer trying to contribute to this project, please follow these steps:- Fork and Clone the repository.
- Run
npm install.
- Export the DATABASE_URL to the environment using
exportor adding it to a ".env" file.
- Run
npm startornpm run start:devto see if it runs without errors.
- Tests can be performed by running
npm test
Contact
Telegram : @uzair_inamdarLicense
GPLv3 [Fork]: https://help.github.com/articles/fork-a-repo/ [Clone]: https://help.github.com/articles/cloning-a-repository/ [Create a Telegram Bot]: https://core.telegram.org/bots#6-botfather [Tutorial]: https://tutorials.botsfloor.com/creating-a-bot-using-the-telegram-bot-api-5d3caed3266d [get the group/channel's chat_id]: https://stackoverflow.com/a/32572159 [wiki]: https://github.com/uzillion/crypto-whale-watcher/wiki [config.js]: https://github.com/uzillion/crypto-whale-watcher/blob/master/config.js [Contribution Guidelines]: https://github.com/uzillion/pg-accessor/blob/master/CONTRIBUTING.md🔗 More in this category