Places buy orders on crypto exchanges based on tweets.
MIT License
Performs trades on Bittrex based on tweets of a user. Searches tweets for any mentions of currencies available on Bittrex. Optionally searches for a key term/phrase first before searching for currencies.
A file named config.json
, located in /src/
(same directory as bot.py
), is
used as the configuration of the bot. Below is the base configuration for the
bot:
{
"twitter": {
"api": {
"key": "",
"secret": "",
"access_token": "",
"access_secret": ""
},
"user": "",
"search_term": "",
"search_text": true,
"search_image": true,
"ignore_retweets": true,
"disconnect_on_first": true,
"log_tweets": false
},
"exchanges": {
"binance": {
"priority": 0,
"key": "",
"secret": "",
"use_multiplier": false,
"recvWindow": 5000
},
"bittrex": {
"priority": 1,
"key": "",
"secret": "",
"use_multiplier": true,
}
},
"order": {
"quote_currencies": {
"btc": 0,
"eth": 0
},
"multiplier": 0
},
"search_currency_name": false,
"tessdata_dir": "",
"tesseract_cmd": "",
"verbose": false
}
Note: All strings, with the exceptions of authentication credentials,
user
,search_term
, andtesseract_cmd
, must be completely lower case.
search_currency_name
- true
to include currency names (in addition tofalse
to only include currency ticker symbols.tessdata_dir
- Path to Tesseract's tessdata folder. Set this if the bottesseract_cmd
- Path to the Tesseract binary; ignored if empty. UnnecessaryPATH
. Backslashes must be escaped with anotherverbose
- true
if the console logger should be more verbose i.e. showfalse
otherwise.key
- Consumer key (API key)secret
- Consumer secret (API secret)access_token
- Access token; can be used to make API requests on your ownaccess_secret
- Access secretuser
- The Twitter handle of the user whose tweets will be read.search_term
- A search term to use to filter the user's tweets; ignored ifsearch_text
- true
to search for currencies in the tweet's text; false
search_image
- true
to search for currencies in the tweet's attachedfalse
otherwise. The image will not be parsed if a currency has alreadyignore_retweets
- Does not parse tweets which are retweets.disconnect_on_first
- true
to disconnect the stream after the first foundfalse
otherwise.log_tweets
- true
to log user's tweets to a file; false
otherwise. A newpriority
- A positive integer representing the priority of the exchange.0
to disable the exchange.key
- The exchange's API key.secret
- The exchange's API secret.use_multiplier
- true
to use the multiplier
for this exchange; false
recvWindow
- If the order request is not processed in this amount ofquote_currencies
- A dictionary of currency ticker symbols for quotemultiplier
- The price paid for the currency is multiplied by1 + multiplier
to account for any price increases between the request for thePATH
environment variable.PATH
environment variable or thetesseract_cmd
is configured accordingly.Note
pipenv
can install these automatically from the provided pipfiles.
OPTIONAL
python-binance
OPTIONAL
python-bittrex
OPTIONAL
pipenv
pipenv can be used to simply the installation
process. Once it is installed, cd
into the root directory and install the
dependencies from the pipfile with
pipenv install
An error may occur while installing python-binance on Windows. More specifically
Failed building wheel for Twisted
The error can be circumvented by downloading a pre-built wheel of Twisted from here. Download the 32-bit or 64-bit version depending on your OS and move the file into the root directory of the program. To install Twisted and finish the installation of python-binance run
pipenv install twisted-wheel-file-name.whl
pipenv install
Run bot.py
to run the bot. If using pipenv:
pipenv shell
cd src
python bot.py
otherwise
python bot.py