gnosis/dx-examples-liquidity-bots

Name: dx-examples-liquidity-bots

Owner: GNOSIS

Description: Example and template for running bots that ensure market liquidity for a given list of token pairs.

Created: 2018-04-30 16:50:17.0

Updated: 2018-05-21 12:43:52.0

Pushed: 2018-05-21 12:43:52.0

Homepage: null

Size: 439

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Run Bots - Dutch X

This is just a simple project that shows how to run the Dutch X bots to ensure liquidity for any ERC20 token pair list.

To make it easier, we provide a Docker image with all the bots and a CLI.

Follow through this document to run your own bots and learn how to operate on the Dutch Exchange.

If you follow through, you'll get:

For aditional information and for reference, check out the following repositories:

Run the bots

Create the running script: Create a script run-bots with the following content:

sr/bin/env bash

er run \
 8081:8081 \
 MNEMONIC="super secret thing that nobody should know" \
 ETHEREUM_RPC_URL=https://rinkeby.infura.io \
 MARKETS=WETH-RDN \
 WETH_TOKEN_ADDRESS=0xc58b96a0278bd2c77bc93e01b148282fb8e753a5 \
 RDN_TOKEN_ADDRESS=0x7e2331beaec0ded82866f4a1388628322c8d5af0 \
 NODE_ENV=dev \
osispm/dx-services:staging \
m run bots


-e MARKETS=WETH-RDN,WETH-OMG \
-e WETH_TOKEN_ADDRESS=0xc58b96a0278bd2c77bc93e01b148282fb8e753a5 \
-e RDN_TOKEN_ADDRESS=0x7e2331beaec0ded82866f4a1388628322c8d5af0 \
-e OMG_TOKEN_ADDRESS=0x8bdd53a53c53fbc40d38231d6219f8cb7b59a704

You can use this one as a template.

Fill the environment variables with your own configuration:

When you run it for the first time, you should see something similar to:

alt text

Don't worry for now about the WARN message shown at the bottom, we'll deal with it in the Fund the bots section.

This script will:

Fund the bots

The bots automatically participate in the auctions performing bids and asks when the time is right.

In order to do this bids and asks, they need to have a balance in the Dutch X smart contract.

For founding the bots, we need to know their Ethereum address, this is determined by the secret mnemonic you've used to run the bots.

An easy way to know the address is just to visit the about endpoint:

You should see among other information, the accounts used by the bots:

alt text

Once you have the bot account, your secret mnemonic and the bots running, you are all set for the funding.

The easiest way is to use the Dutch X CLI.

Check out the Deposit section in Dutch X Cli page

Dutch X CLI (Command Line Interface)

In the docker image, it's also avaliable a CLI, with some basic operations for using the Dutch X.

You can use it for getting the state of a token pair, or to trade in an auction among other things.

Checkout the cli documentation to learn how to use it.

  • Dutch X Cli page
  • Also, you can create a cli script, the same way we did in the run-bots script. You can use this one as a template.
State of a Dutch X Auction

There's a basic command in the CLI that is very helpful to get the state of the auctions.

Example: Get the state of the WETH-RDN aution

i state WETH-RDN

We would get something similar to:

alt text

For other methods, or to learn how to use the CLI go to:

Dutchx Bots

There are 3 bots:

Find out more about them in:

Debug

To increase the debug level, you can change the bot script to run with run bots-dev instead of run bots.

Don't forget to change it back for the production script.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.