How to use Market Maker Bot

trading-bots
saturn-trading-bots

#1

Market-Maker-Bot

Saturn Market Making bot will monitor a token’s order book on Ethereum or Ethereum Classic, creating buy & sell orders for you automatically to keep a token’s marketplace healthy following the strategy you set up.

Source code?

You can find the logic behind Market maker bot and the full source code on our Github account.

hodlstatuslogo

Our MultiChain Saturn HODL token sale allows us to continue developing and releasing innovative tools such as market maker bot for you to use on our platform. Do check it out!

Table of Contents

  1. Before launching your market making bot
  2. How to run Market Making Bot
  3. Market Making features - what is going on?

Before launching your Market Making Bot

  1. You need to install node.js for our trading bot to run, also we recommend you install Hyper. You can follow the guide below to learn how to install node.js on your OS.
  1. Create a new wallet address to use only with your trading bot, you can name your new wallet address appropriately in Saturn Wallet so easily know which wallet is being used by your trading bot & track your balances.


It doesn’t necessarily have to be a new wallet address, but we recommend you don’t use your main hot / trading wallet for running a trading bot as it can become unusable while the bot is running.

  1. Decide which token market you are going to run the trading bot in. Send the funds you are going to use to your trading bot wallet address. Remember this trading bot will be market making (creating buy & sell orders) so you are going to need coin & tokens available to use.
  2. Export your trading bot wallet’s private key as you will need it when you launch your trading bot.
  3. Market Maker Bot is unable to submit an ERC20 Approve transaction. If you wish to run it on an ERC20 token market, then first proceed to make one manual trade with your wallet to complete the ERC20 Approve transaction for the token. ( What is ERC20 approve? )
  4. If your Marker Maker Bot will be running on an Ethereum token market, then you will need register a private node to use. You can get one for free on infura.io, just register an account and Create A Project then copy down your RPC Endpoint which will look something like mainnet.infura.io/v3/XXXXXXXXXXXXXX when you put this into your configuration file you need to add https:// so it will look like this https://mainnet.infura.io/v3/XXXXXXXXXXXXXX.

How to run Market Maker Bot

  1. Once you have node.js installed, run the following command in Hyper: npx @saturnnetwork/market-maker-bot -h it should return the following if you have everything set up correctly:

  1. The .JSON file is the important part where you set up your Market Making trading bot configuration so open up your favourite text editor and paste in the below:
{
  "provider": "https://ethereumclassic.network",
  "blockchain": "ETC",
  "token": "0xac55641cbb734bdf6510d1bbd62e240c2409040f",
  "fundMinimum": "1",
  "tokenLimit": "500",
  "spread": "0.0002",
  "dustCutoff": "0.001",
  "bandSize": "2"
}

Now lets go through each parameter that you can configure your trading bot accordingly, these are settings that you will need to think about depending on the current market:

  • provider - here you can set a custom rpc node endpoint if you wish, if left blank it will use a default public rpc node. If you are operating on ETH, then you should create a private node to use with infura.
  • blockchain - set ETH or ETC accordingly.
  • token - insert the token’s contract address.
  • fundMinimum - this is the amount of ether that will never leave your wallet, above it is set to 1. So if your wallet’s balance is 5 ETC, then market making bot will keep 4 ETC on the order book (create buy orders).
  • tokenLimit - here you set the maximum amount of tokens that you would like to have on the order book at the same time (create sell orders).
  • spread - this is where you set the maximum spread (best sell price - best buy price = spread) market making bot allows before reacting. A smaller spread will mean your trading bot is more aggressive as it may need to cancel & create new orders regularly to keep the bid-ask spread narrow.
  • dustCutoff - is for what we refer to as dust orders which are orders that were not filled completely but only a tiny amount is left, market making bot will automatically cancel these orders to make new ones so that the token’s orderbook looks healthier.
  • bandSize - this parameter is used to calculate when market making bot should prune existing orders and potentially cancel them to create new ones. It calculates a cut off price by doing the following: for sell orders it does mid market price + bandSize * spread and for buy orders mid market price - bandSize * spread. This ensures that market maker bot stays close to the token’s current market price.
  1. Once you are happy with your configuration file, make sure you save it as a .json file with a filepath you can easily find on your system or server. This is where you will need your wallet’s private key you exported earlier. In Hyper or your preferred terminal type the following command:
npx @saturnnetwork/market-maker-bot -p YOUR_PRIVATE_KEY_HERE -j 'C:\Example\SaturnClassicMarketMaking.json'

Note that for your .json filepath, you may not need any brackets ' or your system may need " brackets. If market making bot cannot find your .json file it will display a message couldn't get the module .

If you prefer, you can launch the bot using your 12 word seed phrase but you will need to know your wallet’s ID (if it is Account 1, Account 2 or Account 3) in Saturn Wallet and if you have many accounts already well you have probably lost track. Here is an example of how to do this:

npx @saturnnetwork/market-maker-bot -m "radar blur cabbage chef fix engine embark joy scheme fiction master release" -i 4 -j 'C:\Example\myfirsttradingbot.json'
  1. If you have set up your configuration file correctly, then once you launch market maker bot you will see a market monitor & depth chart being generated every 60 seconds. Congratulations! This means market maker is getting to work & has created orders accordingly:

Market Making features - what is going on?

Market maker bot is completing various checks as it runs, here is a little checklist:

  1. First it checks if an order book is valid, because it needs a way to determine mid market price & work from there. It considers a valid order book to have at least two buy and sell orders, so if the market you want to run it on does not have enough orders it will not run. But you can always make orders from a different wallet manually first!
  2. If there are ever any arbitrage opportunities in the order book, then market maker bot will execute them automatically for you.
    arbitrage
  3. Whenever needed following your cut off parameters, it will cancel orders to free up your balance to make new orders if needed.
    cancels
  4. Market making bot will also tell you if you have reached your ether limit but that it wants to create more orders, then its your decision if you want to send it more coin. Either-way it will keep running.
    market%20making%20notifyy

Happy market making!

If anything is unclear, please ask queries here so I can improve the tutorial.

Future is bright!


Saturn Trading Bot Guides
Getting Started
Market Maker Bot Source Code Released
#2

I finally had a few minutes and set up the Digital Ocean Server. It was so much easier using hyper. (thank you for that) . On windows you can ctl+shift+v and paste command line code verses typing everything using the DO command prompt or windows cmd line tool. Your other guide for setting up Digital Ocean server and this guide worked perfectly. DO has gotten so much easier to work with also verses even 1 year ago.
The market making bot started up and is running now for Stish!

The Saturn Development Team is perhaps the most productive group of folks creating useful products for businesses and traders and noobs in the crypto space. We are very grateful for all that you do and are doing! Thank you very much. :grinning:


#3

Update for provider settings on Ethereum

If you are running Market Maker bot on Ethereum and setting up your node with infura, you need to be sure to add the https:// to your endpoint. So in your JSON file it will resemble the following: https://mainnet.infura.io/v3/XXXXXXXXXXXXXXXXXX

Otherwise you will receive an error message when launching market maker bot.


#4

Source code has now been uploaded and released on our Github.

Market Maker Bot: https://github.com/saturn-network/market-maker-bot
Market Maker Strategy: https://github.com/saturn-network/market-maker-strategy

Have fun!


#5

It sounds pretty simple, but for a person that isn’t a computer whiz, it is pretty complicated. Hopefully, y’all will make it much easier for us regular folks to use. One of the reasons I love being a part of the Saturn.Network community is the developers work to make things where even basic computer users can take advantage of the tools they create. I am not sure how it can be made any easier, but what if there were certain “bots” you could choose from to do certain things and all the user would have to do is put in their wallet address and the coin/token? I personally always get a little nervous when I start doing anything command line related and afraid I am going to crash my computer or something like that. Anyway, I am not sure I am ready to attempt running my own bots quite yet, but hopefully I will find the courage to at least give it a try soon.


#6

Now that the code is made available it will be easier to build out a scenario like you describe. Security is an issue though as if you built something for the masses with a webportal the only semi safe way to do it would be by directly connecting to the bot via meta mask or saturn wallet. I have the bot running on a $5 digital ocean server. It came pre configured with Node.js. I installed the hyper command line tool and followed both the setting up a VPS guide and launching the market maker bot. It took me about an hour all total to get it all running and I’m a noob. I think you could do it @fhstralow. You could try their Google Cloud Guide or set up a free instance and likely run it on AWS also. It sounds way harder than it is. Maybe I am not a noob any more though after doing bots and stuff for 2 years. IDK I don’t feel confident either but It is running!


#7

Yeah @Stish , I should let you have remote access to my computer one day so you can set me up a couple of them there bots. Security is always an issue, but I don’t have enough for hackers to go after, at least not yet.


#8

I have to agree that

Blockquote

“The Saturn Development Team is perhaps the most productive group of folks creating useful products for businesses and traders and noobs in the crypto space . We are very grateful for all that you do and are doing! Thank you very much.” I second that @Stish