How to use Market Maker Bot

Saturn Market Making bot will monitor a token's order book on Ethereum or Ethereum Classic, creating buy and 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.

saturn-network/market-maker-bot
Market Making trading bot for Saturn Network DEX. Contribute to saturn-network/market-maker-bot development by creating an account on GitHub.
saturn-network/market-maker-strategy
Market making logic for Saturn Network DEX. Contribute to saturn-network/market-maker-strategy development by creating an account on GitHub.

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.
How to install Node.js | Saturn Crypto Learning
Here we will go through how to install necessary JavaScript runtimes to use our tools and trading bots. Learn how to install node.js on Windows, Linux and macOS.
  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.

market-maker-1
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:

market-maker-2

  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-maker-3

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.
    market-maker-4
  3. Whenever needed following your cut off parameters, it will cancel orders to free up your balance to make new orders if needed.
    market-maker-5
  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-maker-6

Happy market making!

For support please reach out via our Reddit or via email:

[email protected]

Learn More