To start market making you need to:
You must have a virtual machine or server running Ubuntu 18/20 64-bit. If you haven’t, then go to any VPS service, for example, Digital Ocean, Ramnode, Scaleway, Hetzner.
If your machine has more than 40 GB of disk, 1 GB of memory, then we recommend to install the ADAMANT node on it. This is done in one command—by running the script install_node.sh
on the command line. The bot will work more reliably with the node installed.
For the bot to work on the machine, you need to install MongoDB. Follow these instructions as root
user.
It is better to install the bot under a separate user, in this example, the user adamant
. If you’ve installed the ADAMANT node, then the user adamant
is already in the system, and if not—follow step 5 of the same node installation instruction.
Also you need to install Node.js for the user adamant
. If you’ve installed an ADAMANT node, then Node.js already exists, if not, follow step 6 of the same node installation instruction.
Now you can install the bot program.
Select user adamant
:
su - adamant
Download the bot code from GitHub:
git clone https://github.com/Adamant-im/adamant-tradebot.git
Go to the directory with the bot:
cd ./adamant-tradebot
Install dependencies:
npm i
Done.
The bot accepts commands in the ADAMANT blockchain Messenger. The dialogue with the bot is encrypted and protected from intrusion.
On your local computer or smartphone, create two messenger accounts, one for the bot and one for yourself. Account creation takes less than a minute: https://msg.adamant.im (Clear-web) or http://adamant6457join2rxdkr2y7iqatar7n4n72lordxeknj435i4cjhpyd.onion (Tor application). Get free tokens for both accounts. Take a look at How to start with a blockchain messenger.
As a result, you will have two ADM addresses and two passphrases for them, for example:
Account-1 for the bot:
Account-2 for you:
The bot will use the first account, and you will send commands to the bot from the second. Therefore, open the messenger and log into Account-2, start a chat with your bot and give it a name. You do not need to open an application for Account-1.
Each message from you to the bot and from the bot to you costs 0.001 ADM. Free tokens are enough for the first time, then get more tokens by participating in bounty campaigns https://adamant.im/bounty/ or buy a few—50 ADM per account is enough for a year.
The bot works with the exchange API to get information about current orders and place new ones.
To get API keys, log into your exchange account and create keys in the API section. For example, on the Resfinex exchange, this is the https://trade.resfinex.com/account/apikey. You will receive apikey and apisecret. Some exchanges, like Bit-Z, also require a trading password tradepassword.
Top up the balances on the exchange for the trading pair on which you will make market-making. For example, for the COIN1/USDT pair, you need to deposit the COIN1 and USDT. Don't deposit a lot of money at once until you learn how to operate the bot.
Go back to the server. Enter the directory with the bot:
cd ./adamant-tradebot
Modifying the bot configuration file using nano editor:
nano config.json
Initially, the config file contains default parameters. They need to be changed.
Required parameters:
passPhrase
Bot’s account passphrase (Account-1). Example:
"passPhrase": "record pill lizard broom student ..",
admin_accounts
Accounts from which the bot will accept commands. There may be several of them, but you will specify only one (Account-2):
"admin_accounts": [
"U1470193608913646963"
],
exchange
and pair
Specify on which exchange and on which trading pair the market-making bot will work. Example:
"exchange": "Resfinex",
"pair": "COIN1/USDT",
apikey
, apisecret
, apipassword
Specify exchange’s API keys:
"apikey": "0d5sfswsseef63a104f3adf965",
"apisecret": "8JBSQexbvi5wAaMB9ouEjzgTEXHj0qKmn2WIgve4Jajq",
"apipassword": "", // not needed for this exchange
adamant_notify
or slack
Although not required, we recommend that you provide an ADAMANT or Slack address for notifications. For notifications in ADAMANT it is better to create a third account.
Do not change other parameters—you can do it later. Press F2, y, Enter to save changes in nano.
Settings made.
We recommend using the pm2 process manager to run the bot. If you have installed the ADAMANT node on the server, then pm2 already exists, if not, pm2 can be installed with the command npm install -g pm2
under the user adamant
.
Now you can launch the trading bot (under the user adamant
):
pm2 start --name tradebot app.js
Look at the bot logs with the command:
pm2 logs tradebot
If the bot is working correctly, you will see something like Lovely Trade Bot (U7845253844178751258) started for address U7845253844178751258 (ver. 3.0.17).
To exit the log view mode, press Ctrl^C.
Check if your bot is working correctly—write /help
to it. Write /balances
and the bot will tell your balances on the exchange. If the bot does not respond, then you did something wrong. See logs.
To make the bot work even after restarting the machine, add it to cron:
crontab -e
In the editor, add a line to the end:
@reboot cd /home/adamant/adamant-tradebot && pm2 start --name tradebot app.js
Save.
Before starting market making, go to the exchange website and manually fill in the order book for your COIN1/USDT trading pair. We recommend at least 10 orders for both buy and sell. It is better to fill in order books from another account, and not from the one that the bot uses by API.
The bot will work as you tell it. Check out the list of commands.
Trading volumes on the exchange—are executed buy and sell orders per day. To create volume, the bot trades with itself. It can trade “in spread” so as not to drain your assets, and it can buy from “order books”—then the trades will look very realistic.
Open the messenger application, log into Account-2 and open a chat with the bot.
View your balances on the exchange with the /balances
command.
Set the number of tokens in a single order with the /amount
command. For example:
/amount 1-250
The bot will place orders in the range from 1 to 250 COIN1.
Then set the frequency of placing orders:
/interval 3-350 sec
The bot will trade once every 3-250 seconds.
Daily volume depends on both amount and interval. You will determine these values empirically.
Now you can start market making now:
/start mm
Open the exchange website and see how the bot is trading. If there is no bidding, see the logs.
Dynamic order book filling is enabled by default. This can be changed using the /enable ob
and /disable ob
commands.
You can enable support for spread and liquidity with the /enable liq
command, and control the price with the /enable pw
command.
View all current parameters: /params
.
Watch for notifications that the bot sends you. For example, if there are not enough balances for market making, the bot will notify you.