-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from patbaumgartner/master
Major Refactoring
- Loading branch information
Showing
18 changed files
with
982 additions
and
696 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,85 @@ | ||
# Binance-pump-alerts | ||
# Binance Pump Alerts | ||
|
||
Simple application which gets price data from binance API and sends telegram message based on parameters set used to detect pumps in Binance. | ||
BPA is a simple application which gets the price data from Binance Spot or Futures API and sends Telegram messages based on parameters set used to detect pumps and dumps on the Binance Exchange. | ||
|
||
Working demo telegram channel: https://t.me/binance_pump_alerts (Hosted on AWS ec2 running latest version 24/7) | ||
[Demo Telegram Channel](https://t.me/binance_pump_alerts) hosted on AWS ec2 running the latest version 24/7. | ||
|
||
![image](https://user-images.githubusercontent.com/63389110/128601355-4be90b36-5e54-4be6-bf85-00fc395645de.png) | ||
|
||
## Usage | ||
## Manual Setup | ||
|
||
1. In command line run `pip install -r requirements.txt` while located at folder with code. | ||
2. Get telegram bot token from @botfather https://t.me/BotFather | ||
3. Get telegram chatId from @get_id_bot https://telegram.me/get_id_bot (Alternatively channel id can be used as well which is shown in demo) | ||
4. Add pairs to watch into watchlist or leave it empty to monitor all tickers on binance | ||
5. Run "pumpAlerts.py" with command `python pumpAlerts.py` | ||
1. On the command-line, run the command `pip install -r requirements.txt` while located at folder with code. | ||
1. Create a new telegram bot token from [@botfather](https://t.me/BotFather). | ||
1. Get telegram `chat_id` from [@get_id_bot](https://telegram.me/get_id_bot). | ||
- Alternatively, a `channel_id` can be used as well. | ||
1. Add pairs to watch into the watchlist or leave it empty to monitor all tickers on Binance. | ||
1. Run the script with the command `python pumpAlerts.py`. | ||
|
||
## Docker Setup | ||
|
||
### Mandatory Params | ||
|
||
1. TelegramToken: Telegram bot telegramToken obtained from @BotFather | ||
2. TelegramChatId: Bot will send message to this id, it can be a group or channel as well. To get personal telegramChatId, get it from @get_id_bot | ||
|
||
|
||
## Main Customizable Params | ||
1. Use environment variables in the `docker-compse.yml` file to provide your config. | ||
- See `entrypoint.sh` for environment variable names and the config possibilities. | ||
- You can also use a `.env` file during development. | ||
- If changing the config parameters, you have to make sure that search and replace will place the right parameter in the `config.yml` | ||
- Emojis are more tricky therefore defining it with some tricks e.g. `PUMP_EMOJI="! \"\\\\U0001F4B9\""` | ||
1. On the command line run `docker-compose up -d --build` to create and run the docker image/container. | ||
|
||
1. chartIntervals: Can be modified to consider other timeframes, follow the format of 's' for second, 'm' for minute, 'h' for hour | ||
2. Outlier param: (0.01 -> 1% , 0.10 -> 10%), modify accordingly based on needs. Avoid setting it too low to avoid noise | ||
3. extractInterval: Default '1s' , interval at which we get the price information from Binance | ||
4. Pairs of interest: Default is USDT (Other options include BTC, ETH etc) | ||
## Configuration | ||
|
||
### Mandatory Params | ||
|
||
### Alert Interval Params | ||
1. `telegramToken`: The token obtained from[@botfather](https://t.me/BotFather). | ||
2. `telegramChatId`: The bot will send the messages to this `chat_id`. It can be a group or channel as well. | ||
|
||
1. hardAlertIntervalEnabled: (Main) Prevents triggering of same interval for the timeframe of the interval. E.g. '5m' triggers. Will not trigger intervals >= '5m' for 5 minutes. Other intervals < '5m' such as '1s' , '5s' will continue being triggered. | ||
2. HardAlertMin: (Legacy) Set hardAlertIntervalEnabled to false to enable this. Does not trigger another alert within same pair for the specified duration | ||
## Main Customizable Params | ||
|
||
1. `chartIntervals`: Can be modified to consider other timeframes, follow the format of 's' for seconds, 'm' for minutes, 'h' for hours. | ||
1. `outlierIntervals`: (0.01 -> 1% , 0.1 -> 10%), modify accordingly based on needs. Avoid setting it too low to avoid noise. | ||
1. `extractInterval`: Default is `1s`, Interval at which we retrieve the price information from Binance. | ||
1. `pairsOfInterest`: Default is _USDT_. Other options include BUSD, BTC, ETH etc. | ||
1. `topReportIntervals`: Default is `1h`,`3h`and `6h` Intervals for top pump and dump reports to be sent, ensure it is in chartIntervals + outlierIntervals as well. | ||
|
||
### Optional features to enable | ||
|
||
1. Watchlist: Default if left empty it'll look at ALL symbols after filtering by pairs of interest. If pairs are added to watchlist, program will **only track the pairs specified**. | ||
2. FuturesEnabled: If true program will monitor **future** market else it will monitor **spot** market. | ||
3. DumpEnabled: If true program will alert on **DUMP** as well. | ||
1. `watchlist`: Default if left empty it'll look at ALL symbols after filtering by pairs of interest. If pairs are added to the watchlist, the application will _only track the pairs specified_. | ||
1. `dumpEnabled`: If `True`, the application will alert on dumps as well. | ||
|
||
#### Top Pump & Dump Params | ||
|
||
1. TopPumpEnabled: If true program will send top X pumps at defined interval | ||
2. TopDumpEnabled: If true program will send top X dumps at defined interval (Together with pump information if enabled) | ||
3. ViewNumber: Top X amount of coins shown, adjust to show more or less within the timeframe | ||
4. TelegramAlertChatId: Insert Chat ID for top pump dump alert, if left at 0 it'll send to telegramChatId | ||
1. `topPumpEnabled`: If `True`, the application will send the Top X pumps at the defined interval. | ||
1. `topDumpEnabled`: If `True`, the application will send the Top X dumps at the defined interval. | ||
- Together with pump information, if enabled. | ||
1. `noOfReportedCoins`: Top X amount of coins shown, adjust to show more or less within the timeframe. | ||
1. `telegramAlertChatId`: Insert the alert chat_id for top pump dump alert, if left at `0`, it'll send messages to the telegram `chat_Id`. | ||
For params not indicated above, refer to comments besides parameter for its use. | ||
|
||
#### Debug Params (Avoid modifying if possible) | ||
1. Debug: Default 'False', only enable for debugging. Logging set to info level message and above | ||
2. ResetInterval: Default '12h', clears the array used to store data points to prevent MEM ERROR | ||
3. priceRetryInterval: Default '1s' # In the case of get price fail, this is the time delay before re-attempt | ||
4. telegramRetryInterval: Default '1s' # If telegram message fails to send, this is the time delay before re-attempt | ||
5. tdpaInitialBuffer: Default '5m' # Initial buffer before we trigger TDPA. Prevents all 0% output due to lack of data points | ||
6. checkNewListingEnabled: True # Disables checking and adding of new listing pairs. | ||
|
||
#### Debug Params (Avoid modifying if possible!) | ||
|
||
--- | ||
1. `debug`: Default is `False`. Please, only enable for debugging purposes. Default logging set to info level. | ||
1. `resetInterval`: Default `12h`. It clears the array used to store data price points to prevent memory issues. | ||
1. `priceRetryInterval`: Default `5s`. In the case of get price fail, this is the time delay before re-attempt | ||
1. `telegramRetryInterval`: Default `2s` # If telegram message fails to send, this is the time delay before re-attempt. | ||
1. `checkNewListingEnabled`: Default `True`. Enables checking and adding of new listing pairs. | ||
|
||
## Todo | ||
|
||
1. Integrate with binance API to make trades on pumps | ||
2. Integrate with listing-predictor to monitor movements for potential listings | ||
1. Integrate with Binance API to make trades on pumps. | ||
1. Integrate with Binance Websocket API to get volume information. | ||
1. Integrate with listing-predictor to monitor movements for potential listings. | ||
|
||
## Completed features | ||
|
||
1. Telegram integration | ||
2. Price Update every 1s | ||
3. Adjustable alert % param | ||
4. Watchlist feature | ||
5. Monitor future markets | ||
6. Optional alert on dumps | ||
7. Customizable minimum alert interval for spam prevention | ||
8. Option to disable print debugs on extraction | ||
9. [Test] Volume Change Updates (TEST_VOL version) | ||
10. Allows long period of running without MEM ERROR | ||
11. Send periodic Top X dumped / pumped coins | ||
12. Docker Integration (Thanks to @patbaumgartner) | ||
13. Logging Integration (Thanks to @patbaumgartner) | ||
1. Price update every 1s | ||
1. Adjustable alert % param (outliers) | ||
1. Watchlist feature | ||
1. Monitor future markets | ||
1. Optional alert on dumps | ||
1. Customizable minimum alert interval for spam prevention | ||
1. Option to disable print debugs on extraction | ||
1. [Test] Volume Change Updates (TEST_VOL version) | ||
1. Allows long period of running without memory issues | ||
1. Send periodic Top X Pump & Dump reports | ||
1. Docker integration (Thanks to [@patbaumgartner](https://github.com/patbaumgartner)) | ||
1. Logging integration (Thanks to [@patbaumgartner](https://github.com/patbaumgartner)) | ||
1. Major Refactoring and cleanup (Thanks to [@patbaumgartner](https://github.com/patbaumgartner)) |
Oops, something went wrong.