Crypto Pump and dump alert in Python

Anupam vashist
Karma and Eggs
Published in
4 min readMay 15, 2018

I have been trading crypto coins for a year now and anyone who has been trading this long would know how this space is rigged with uncertainties, fear and deception. It all started with Bitcoin and it is indeed ironic how a system that that obviates trust among it’s users is now somehow propagated into a behemoth of scams, loot and manipulation — all this started when we started “Trading” these coins.

For those who do not know what it is about, i’ll give a brief overview.

Back in 2013 there were only a few players in crypto market. It is 2018 and If you go to coinmarketcap now, there are more than 1300 currencies listed there. Meanwhile, there have been a big number of “promising” cryptocurrencies that were designed to “go to the moon” are extinct to the point that you can’t find their trace on the internet. Where did the money go?

Well, the number one rule of money is- Someone has to lose if someone else has to win. Let’s look at how this works:

Pump and dump operations operate in a relatively straightforward manner. These scams typically involve artificially inflating the price of a less-popular token through the dissemination of false news in an attempt to hype, or “pump” it.

There are two parties involved in a pump and dump scam. The first are the market players that “pump” a token — commonly a less-popular cryptocurrency. These players buy up a significant amount of these tokens and begin pumping them across social media.

For pumpers, tokens that are easily manipulated are the best target. These tokens often possess a relatively low circulating supply and a small market cap. Pumpers will operate in groups, often working via Telegram, and will purchase these tokens en masse, which causes the value of the token to rise.

At this point, the “pump” begins to take hold across social media, which causes external investors to begin purchasing the token. Smaller investors often buy in at this point due to the FOMO, or “fear of missing out” effect. This causes the value of the token to increase further.

Look at the highlighted areas in the graph above. This is a shitcoin named “Polymath”. What a gimmick!

Once the pump has caused token value to increase dramatically, the original pump group then sells off their token holdings in a coordinated move, selling their token reserves to the new, unsuspecting investors. This massive sell-off causes the value of the token to plummet, “dumping” the token price.

The pumpers then walk away with massive profits, leaving those not included in the pump and dump group with relatively worthless assets they purchased at a massively inflated price.

The matter at hand is to somehow get an alert if a pump or dump is happening. although looking at the historical graph it seems easy to find a pattern explained above, but history doesn’t earn money. so we will make a pump and dump detector using python and cryptocompare api which raises alarms in real time and you can act on your investment without the hassle of keeping one eye on the chart 24*7.

Here we go:

Importing necessary libraries

We need to add 2 functions to our code.

play (musicfile, vol) is simple- it takes a musicfile from your system (.wav or .mp3) and sound volume (0–1) as user input and plays the file when alert is prompted. This function is being called inside a second function-

run_alerts(URL,initial_data,sleeptime,vol)

URL: The url of api that we are dealing with. we will configure this in further code.

initial_data: The state of coin at the time when program is started.

sleeptime: We need to check a percentage change in a percentage time. sleeptime is the frequency our program will hit the api with.

Vol is the same as the above function.

Let’s run the code. Below, the parameters that i have used are 0.03% change in 15 seconds- which is only a dummy scenario. the 2 alerts are underlined below to show how it works.

For this to work, we are aiming at a 5% rise in 5 minutes to be declared as a pump according to pumpdump. Though in my experience, a 2% change in 2–3 minutes can be an early sign of a pump so you can get in quick and get fast quick. Also, this program allows to set up multiple alerts and you can play with several pairs of %change in %time so let you get started.

Hope this helps. In another post, we program a simple arbitrage calculator and see how it affects predictions on local vs global prices.

Play safe, dont be greedy, exit fast and NEVER RISK MONEY YOU DON’T HAVE.

--

--