Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency.

Overview

Elonbot

Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency. Here is how it works:

  1. Subscribes to someone's (elonmusk?) tweets
  2. Automatically detects mentions of DOGE or other crypto in the image(or text) Elon's tweet
  3. Buys crypto on Binance
  4. Sells it after --auto-sell-delay seconds

Installation

git clone http://github.com/vslaykovsky/elonbot
pip install python-binance google-cloud-vision unidecode

Running

  1. Set up Twitter access keys.
    • Go to developer.twitter.com to create your developer account
    • Generate a bearer token
    • Set up an environment variable with the bearer token.
      • Linux: export TWITTER_BEARER_TOKEN="<YOUR BEARER TOKEN>"
      • Windows: set TWITTER_BEARER_TOKEN="<YOUR BEARER TOKEN>"
  2. Set up Binance access keys.
    • Go to Binance and create a trader account if you don't have it yet
    • Go to API management page and copy your API key and secret
    • Export both keys:
      • Linux: export BINANCE_KEY="<your API key>"; export BINANCE_SECRET="<your secret key>"
      • Windows: set BINANCE_KEY="<your API key>" & export BINANCE_SECRET="<your secret key>"
  3. [Optional] Add image text recognition support with Google OCR
    • Use the following documentation to access Google Vision API
    • Export path to your google vision configuration.
      • Linux export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/google_vision_credentials.json"
      • Windows set GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\your\google_vision_credentials.json"
  4. Run elonbot.py

Here are some examples of how to run Elonbot. All examples are provided for Linux. For Windows make sure you use correct escaping

With image text recognition:

python elonbot.py --user=elonmusk --margin-type=cross_margin  --crypto-rules='{"doge": "DOGE", "btc|bitcoin": "BTC"}' --auto-sell-delay=600  --order-size=max  --use-image-signal

No image text recognition

python elonbot.py --user=elonmusk --margin-type=cross_margin  --crypto-rules='{"doge": "DOGE", "btc|bitcoin": "BTC"}' --auto-sell-delay=600 --order-size=max

Dry run (only prints debug output, no orders are executed)

python elonbot.py --user=elonmusk --margin-type=cross_margin  --crypto-rules='{"doge": "DOGE", "btc|bitcoin": "BTC"}'  --auto-sell-delay=60 --order-size=max --dry-run

Get help:

(base) C:\Users\vslay\Desktop\notebooks\elon>python elonbot.py --help
usage: elonbot.py [-h] --user USER --crypto-rules CRYPTO_RULES --margin-type MARGIN_TYPE [--auto-buy-delay AUTO_BUY_DELAY] [--auto-sell-delay AUTO_SELL_DELAY] [--asset ASSET] [--use-image-signal]
                  [--order-size ORDER_SIZE] [--dry-run] [--process-tweet PROCESS_TWEET]

Trade cryptocurrency at Binance using Twitter signal

optional arguments:
  -h, --help            show this help message and exit
  --user USER           Twitter user to follow. Example: elonmusk
  --crypto-rules CRYPTO_RULES
                        JSON dictionary, where keys are regular expression patterns, values are corresponding cryptocurrency tickers. elonbot.py uses regular expressions to find tweets that mention
                        cryptocurrency,then buys corresponding crypto ticker
  --margin-type MARGIN_TYPE
                        isolated_margin or cross_margin. These are two margin types supported by Binance. Read this article to understand the difference:
                        https://www.binance.com/en/blog/421499824684900602/Binance-Margin-Differences-Between-the-New-Isolated-Margin-Mode-and-Cross-Margin-Mode. You must transfer your assets to isolated
                        margin or cross-margin to use this script
  --auto-buy-delay AUTO_BUY_DELAY
                        Buy after auto-buy-delay seconds
  --auto-sell-delay AUTO_SELL_DELAY
                        Sell after auto-sell-delay seconds
  --asset ASSET         asset to use to buy cryptocurrency. This is your "base" cryptocurrency used to store your deposit. Reasonable options are: USDT, BUSD, USDC. You must convert your deposit to one
                        of these currencies in order to use the script
  --use-image-signal    Extract text from attached twitter images using Google OCR. Requires correct value of GOOGLE_APPLICATION_CREDENTIALS environment variable.Check
                        https://github.com/vslaykovsky/elonbot for more details
  --order-size ORDER_SIZE
                        Size of orders to execute. 1.0 means 100% of the deposit; 0.5 - 50% of the deposit; 2.0 - 200% of the deposit (marginal trade)"max" - maximum borrowable amount. max corresponds to
                        3x deposit for cross-margin account and up to 5x for isolated-margin account
  --dry-run             Don't execute orders, only show debug output
  --process-tweet PROCESS_TWEET
                        Don't subscribe to Twitter feed, only process a single tweet provided as a json string (useful for testing). Example value: '{"data": {"text": "Dodge coin is not what we need"},
                        "includes": {"media": [{"url": "..."}]}}'
A minimal open source mtg-like tcg game made in python that can be played on a terminal emulator using a keyboard.

TCG-TERM Project state: 🔧 🚧 🚧 🚧 Incomplete, In development 🚧 🚧 🚧 👷 (Keep in mind that at the moment, This project is currently undone, and wil

Amos 3 Aug 29, 2021
Telegram Bot Repo Capable of fetching the following Info via Anilist API inspired from AniFluid and Nepgear

Telegram Bot Repo Capable of fetching the following Info via Anilist API inspired from AniFluid and Nepgear Anime Airing Manga Character Scheduled Top

Rikka-Chan 2 Apr 01, 2022
Wordle-bot: A Discord bot to track you and your friends' Wordle scores.

wordle-bot A Discord bot to track you and your friends' Wordle scores, so you can see who's the best! To submit a score to wordle-bot, just paste the

Spencer Murray 8 Feb 16, 2022
A Google Charts API for Python, meant to be used as an alternative to matplotlib.

GooPyCharts A Google Charts API for Python 2 and 3, meant to be used as an alternative to matplotlib. Syntax is similar to MATLAB. The goal of this pr

Sagnik Ghosh 202 Oct 04, 2022
Python based league of legends orbwalker

League of Legends Orbwalker Usage Install python3 Create a python3 venv Install the requirements pip install -r requirements.txt Get in game and run m

Inusha 43 Dec 12, 2022
Parse discord tokens from any file, even if there is other shit in the file with them.

Discord-Token-Parser Parse discord tokens from any file, even if there is other shit in the file with them. Any. File. I glued together all html from

4 May 07, 2022
PyFacebook

== PyFacebook == PyFacebook is a Python client library for the Facebook API. Samuel Cormier-Iijima ( Samuel Cormier-Iijima 573 Dec 20, 2022

A Discord bot that may save your day by predicting it.

Sage A Discord bot that may save your day by predicting it.

1 Nov 17, 2022
Pretend to be a discord bot

Pretendabot © Pretend to be a discord bot! About Pretendabot© is an app that lets you become a discord bot!. It uses discord intrigrations(webhooks) a

Advik 3 Apr 24, 2022
alpaca-trade-api-python is a python library for the Alpaca Commission Free Trading API.

alpaca-trade-api-python is a python library for the Alpaca Commission Free Trading API. It allows rapid trading algo development easily, with support for both REST and streaming data interfaces

Alpaca 1.5k Jan 09, 2023
EC2 that automatically move files received through FTP to S3

ftp-ec2-s3-cf EC2 that automatically move files received through FTP to S3 Installation CloudFormation template Deploy now! Usage IP / domain name: ta

Javier Santana 1 Jun 19, 2021
Collaboration with Microsoft, AWS, Google, and ETHZürich Analytics Club (2022 Datathon Project)

DATATHON_ Collaboration with Microsoft, AWS, Google, and ETHZürich Analytics Club (2022 Datathon Project) Datathon Original Challenge SAV DataDays Rei

esthi 34 Nov 10, 2022
My attempt to reverse the Discord nitro token generation function.

discord-theory-I PART: I My attempt to reverse the Discord nitro token generation function. The Nitro generation tools thing is common in Discord now,

Jakom 29 Aug 14, 2022
Embed the Duktape JS interpreter in Python

Introduction Pyduktape is a python wrapper around Duktape, an embeddable Javascript interpreter. On top of the interpreter wrapper, pyduktape offers e

Stefano 78 Dec 15, 2022
Discord Token Generator - Python (Generates Tokens and Joins your Server Automatically) hCaptcha Bypass **FREE**

Best Discord Token Generator {hCaptcha bypass FREE Unlimited Memberboost} Install few requirements & run main.py it will redirect you to the Download

1 Oct 27, 2021
💀 The first raid tool of its kind. Inject Deadcord and raid servers directly from the Discord client.

💀 Deadcord The next upcoming Discord raid tool, the best for free. 🎉 Early Beta Released We have released an early version of Deadcord, please keep

Galaxzy 157 May 24, 2022
Use an air-gapped Raspberry Pi Zero to sign for Bitcoin transactions! (and do other cool stuff)

Hello World! Build your own offline, airgapped Bitcoin transaction signing device for less than $35! Also generate seed word 24 or generate a seed phr

371 Dec 31, 2022
To send an Instagram message using Python

To send an Instagram message using Python, you must have an Instagram account and install the Instabot library in your Python virtual environment.

Coding Taggers 1 Dec 18, 2021
Example of Telegram local API and aiogram 3.x

Telegram Local Full example of Telegram local application. Contains Telegram Bot API Local Telegram Bot API server based on aiogram Bot API Server ima

Oleg A. 9 Sep 16, 2022
Python client library for Bigcommerce API

Bigcommerce API Python Client Wrapper over the requests library for communicating with the Bigcommerce v2 API. Install with pip install bigcommerce or

BigCommerce 81 Dec 26, 2022