Crypto trading & Market making bot in ADAMANT

ADAMANT Messenger
Mar 13 · 7 min read

Yes, there are already a lot of cryptocurrency trading bots, but we did our part. This is how it differs:

  • Managed with your commands using ADAMANT Messenger
  • Easy to install and configure
  • Free and open source
  • Fill order books
  • Place buy and sell limit or market orders
  • Market making
  • Dynamic order book building
  • Stores and displays statistics

Supports exchanges (more in progress):

Image for post
Image for post

Crypto trading for profit

You can trade manually, or automatically — launched a trading bot, and then just wait for profit.

Trading bots — is it profitable? If you’re lucky. That is, the probability of success is 50%. If someone tells you that he has a trading bot that will definitely make a profit, you should tell that guy to fuck off. When you stay in the red, he will explain that there was a very rare case, the market situation and another 100,500 excuses. Even if there was (it is not) a bot that gives a positive result in 99% of cases, it is yours that can be negative. Think about why companies sell trading bots instead of trading themselves? Because trading cryptocurrencies is a big risk, regardless of whether you use a bot or trade manually.

Trading opportunities for profit of our bot are limited now, but we will work on it. The first task is to fill order books and make trading volumes.

Market making

It is no secret that 95% of the volumes on cryptocurrency exchanges are fake. If you have a small cryptocurrency project and you have listed the token on a small exchange, the trading volume will be 0 — where can it come from if there is no volume even with top coins? Everyone loves numbers on coinmarketcaps, so users will not buy your token, and other exchanges will refuse to list it — the realities of life.

You will have to create trading volume by yourself, as well as fill order book. You pay for this with exchange fees.

How the trading bot works

A trading bot is a program that is constantly running on the server. After installation, you specify in the settings which exchange to work with and which pair to trade. A bot:

  • Keeps track of your incoming commands, for example, start trading or change parameters
  • Performs trading operations in accordance with your settings and trading strategy
  • Notifies of all operations

You sent commands to a bot via ADAMANT Messenger. So, you need two ADM accounts, one for you, and one for a bot.

What you need to start a bot

  • Basic work skills with Linux and Node.js
  • A server. The requirements are minimal. Any virtual machine on the cloud hosting like Digital Ocean, Ramnode, Scaleway, Hetzner will be enough. Installation of the ADAMANT node is not necessary.
  • If you don’t have an ADAMANT account yet, create it and get free tokens. You’ll use this account to send commands to your bot—put account’s address like U15677078342684640219 to in the config. We recommend you to read how to start with a blockchain messenger.
  • Create your ADAMANT wallet for the bot and get free tokens. The bot will use this account to receive your commands and send replies back. Set its in the config.
  • While you talk to the bot, you spend few ADM tokens, as every message costs 0.001 ADM. You can get 50+ ADM for free, automatically and instantly: https://adamant.im/bounty/. These tokens will be enough for years.
  • Install a bot program on the server and adjust the config-file
  • Put in the config the keys of your account on the exchange and replenish the balances of those cryptocurrencies you to trade with the bot. If you don’t have the keys, go to your exchange’s account settings, and create ones. For example, on Resfinex go to https://trade.resfinex.com/account/apikey
  • Your trading pair’s order book shouldn’t be empty. It must have at least one bid and one ask.
  • Run the bot and test how it works

Commands

The ADAMANT trading bot understands the commands:

  • : Show help
  • : Find out the market price of the coin and/or the ask and bid prices on the exchange for the trading pair
  • : Show information on the trading pair on the exchange. Prices, trading volumes and market making stats.
  • : Display the number of active orders for the trading pair
  • : Calculate the price of one cryptocurrency in another at the market price and at the exchange prices
  • : Display your balances on the exchange
  • : Start trading or market making
  • : Stop trading or market making
  • : Enable option
  • : Disable option
  • : Set the amount range for market making orders
  • : Set the frequency of transactions for market making
  • : Set the percentage of buy orders for market making
  • : Fill sell or buy order book
  • and : Place a limit or market order
  • : Get a deposit address for a coin
  • : Cancel active orders
  • : Show bot’s software version

For more information on bot commands, see the help, .

Image for post
Image for post

Setup and configuration

The trading bot is a software program with an open source code. The instructions are not difficult and could be found on GitHub. These instructions are enough for the advanced linuxoids, but we’ll give the mere mortals some explanation.

You have to get a virtual machine or a server with Ubuntu 16/18 64-bit. If you don’t have it, then use any VPS server, e.g.: Digital Ocean, Ramnode, Scaleway, Hetzner.

If your computer has more than 40 GB and 1 GB of memory, we recommend installing an ADAMANT node on it. It requires only one command — startup of a script in the command line. Although, there’s no need to get the node.

It’s recommended installing the bot under the username . If you have installed the node, then the user is already in the system. If you haven’t — do the fifth step from the same instruction on installing the node.

In order to make the bot function, you need to install NodeJS and MongoDB on your computer. If you have installed the node, then NodeJS is already there. If you haven’t — do the sixth step from the same instruction on installing the node. There’s also a guide on how to install MongoDB.

Now you can install and adjust the bot.

Choose the user :

su - adamant

Download the bot code from the GitHub:

git clone https://github.com/Adamant-im/adamant-tradebot

Go to the catalog with the bot:

cd ./adamant-tradebot

Install the dependencies:

npm i

Done. Now let’s start adjusting.

Change the configuration file of the bot in the editor:

nano config.json

Initially, the settings there are set by default. You need to change them. In order to save the changes in the editor, press F2, y, Enter. After that, the configuration will be done.

Parameters to set:

  • The bot’s secret phrase for accepting commands—you have to create separate ADM account for the bot. Obligatory. Bot’s ADM address will correspond this passPhrase. Example:
"passPhrase": "scatter tomato doctor also stay tell success pause gift clip hungry october",
  • Put your personal ADM account address here, so the bot will accept your commands. Note: your personal ADM account and bot’s ADM account should be different. Example:
"admin_accounts": [    "U14818108337685946763"],
  • and Set an exchange and trading pair to work with. Example:
"exchange": "Resfinex",
"pair": "ADM/USDT",
  • and How much decimals have coins you trade on selected exchange? Example:
"coin1Decimals": 2, // 0.12 ADM"coin2Decimals": 6, // 0.123456 USDT
  • , , Your credentials on the exchange. Example:
"apikey": "0d5sfswsseef63a104f3adf965",
"apisecret": "8JBSQexbvi5wAaMB9ouEjzgTEXHj0qKmn2WIgve4Jajq",
"apipassword": "", // not needed for the exchange I choose
  • or Though it is not obligatory, we recommend to set one or both these parameters to get notifications from the bot. It will tell you if problems occur. If you choose to get notifications to ADAMANT account, put the ADM address to —you can use the same from , but it is more convenient to create separate one.

Set other parameters in the config as you wish.

We recommend using process manager to launch the bot. If you have installed the ADAMANT node, then is already there, if you haven’t — can be installed with the following command:

Now you can launch the bot (under the user’s name );

pm2 start --name tradebot app.js

Make sure that your trading bot works properly. Text him. If the bot doesn’t reply, it means you did something wrong. Look through the logs with the following command:

pm2 logs tradebot

In order to make the bot work after the reboot, add it to the :

crontab -e

Add the following bar at the end:

@reboot cd /home/adamant/adamant-tradebot && pm2 start --name tradebot app.js

And save it.

Now your bot is running. Send command to test it. If everything is fine, you’ll get a reply.

What else

All of these cryptocurrencies are risky things. Only you are responsible for your actions.

There are other bots in ADAMANT.

adamant.im

Relax. You are safe now.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store