Automated Crypto Trading Bot to Buy Pump and Dump Sentiment Signals from Twitter

Posted by

View This Article in it’s Original Form on Jare.Cloud!

Join our growing Telegram community for blog updates, bot chat, general fun and crypto madness? https://t.me/ManyVolumeSignalMonster

Strategy

  1. We follow Twitter accounts we trust: exchanges, coins, Twitter crypto influencers
  2. We wait around until someone tweets a coin name or coin ticker
  3. We measure the sentiment of the message: is it buy or sell?
  4. On strong buys, or multiple instances of buys in a period of time, we execute a market buy order on Binance Spot
  5. We wait around until our exits are hit
  6. 1 out of every 3-4 signals we act on the crowd will also act on…
  7. …meaning there’s upwards potential for everyone
  8. and we can net 100s 1000s% gains!

In practice:


NLTK & New Words

The Python programming language has a package called Natural Language Tool Kit, or NLTK. Inside NLTK are lexicons that you can use to accomplish different goals – in our project, the Vader Lexicon is useful because we can rank all sorts of English words on a scale of -1 to 1 based on how strongly they express good or bad emotions. This is called ‘sentiment analysis.’

We add some new words to the mix.. given our very specific scenario.

Weighted Twitter Accounts and Tiers

Of the accounts in our followed list, we’ll have exchanges, coins and crypto influencers. Of these, exchanges have the highest amount of influence when they make an announcement about an alt, the coins themselves have a medium amount and the influencers have a variable but usually less amount.

We organize each account we follow (or simply have in a static list) into a list with corresponding ratios for how they affect our sentiment scores.

Parsing and Referencing All the Binance Spot Coins

Here’s what Binance’s 24hr ticker endpoint looks like:

We loop through all these results, look for ones that end in BTC and then replace the BTC out of the symbol string – leaving the coin.

We now have a list of coins!

Get Twitter Followed, 100 Recent Tweets Within Last Hour

This is optional and I may replace the followed list with a flat and static file or coded list, but presently the bot will read the followed list and then loop through it, grabbing everyone’s 100 most recent tweets (and and/or and not retweets – optional) and then cycle through those to see which occurred in the last (given timeframe). These are the goldmoney… we save tweets we’ve previously indexed to an array so as to not re-index them.

Find Potential Coinnames, Compare to Our Binance List and Tweeter List

We split the text of the tweets up by ‘ ‘ (space) and ‘\n’ (newline). We then look at each resulting word or hashtag, capitalize them and compare them (or $ + the word, like $MANA or $mana or mana or Mana) against our list of tickers from the Binance API. We also then compare against a list of tickers that correspond to specific Twitter accounts, in the event of something like the MANA tweet above that didn’t mention ‘MANA.’ So we can tell that decentraland tweets are, usually, unless otherwise specified, for MANA.

For High Sentiment Scores, Buy

On Binance we market buy with a % of our holdings. The % is configurable, and depends on someone’s aversion to risk.

For Repeat Occurrences, Buy Again

If another one of our trusted tweeters tweets another signal confirming the same trend, we ‘double down’ and buy another % of remaining balance worth of the coin.

1% Trailing Take Profit

If the price immediately drops 1%, we gracefully exit as a stoploss and count our losses. If the price goes up 2% and then down 1%, we exit the trade at 1% gains less fees. If, however, the coin goes up 10% 40% 100% before dropping 1% – as it might do with mass hysteria – then we laugh all the way to the bank! 1%, of course, is configurable.

Rinse, Wash, Repeat

Another signal another coin another potential 100%!

Considerations

We want to use a custom list of crypto influencers because most of the people calling out signals on twitter are actually doing so in their own vested interest – having posted a buy signal in their private Pump & Dump discords, their private group buys up the coin and then – 5 minutes later – they all post signals to their twitters and bought ‘influencer’ twitters as tweets that seem to double, triply, quadruply confirm each other. In reality, these folks are dumping by the time anyone else starts to buy in – meaning that you’d likely face losses if you used a twitter-wide sentiment analysis and automated trading tool. This is where all existing tools – including AI-driven ones – fail in this space, and why my bot has a considerable edge on the competition.

Next Steps

I’d like the bot to keep track of the win/lose rate and severity of wins/losses from specific tweeters, so that it can potentially modify the sentiment score by a previous success factor – so if someone was right about a buy signal 2/5 times it’s worth more than someone with 1/5 times. If someone is right 1/10 times, though, and their signal does 25x better than the first two in these examples – that one is worth considerably more.

It’d be nice to incorporate a python django webserver like a hackathon starter so I can take advantage of their Twitter oauth2 sign-in scheme. This way I can potentially have accounts log in without supplying their own twitter API credentials – which require an application process now – and more accounts can work with my bot. This would increase the amount of actionable data and win/loss rates and severities that can be used to package tailored lists of tweeters to know.