JellyButler

What is Butler?

Butler is automated market making software that is used for liquidity provision to JellySwap protocol. Everyone can run Butler instance on his/her own machine and start earning interest from market spreads. Butler supports automatic order matching, withdraws, refunds, portfolio rebalancing, email and slack notifications. Supported coins are BTC, ETH, DAI, AE, WBTC.

How to install Butler?

There are two main approaches to install Butler:

  1. Using Docker

  2. Manual Setup

You can find and freely download the software from this link:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

How to setup Butler via Docker?

The first requirement is to setup Docker on your system.

To install Docker on Mac follow this quick guide: https://docs.docker.com/docker-for-mac/install/

Once, you have successfully installed docker on your system you can clone/download the Butler official distribution from here:

Open Butler download folder - it should have the following structure:

Update .env file with the desired value for mongodb password.

Now you should edit config.ts file which is in the root folder of the project.

You can generate Binance API key from your Binance exchange account

For Cryptocompare API Key you can use this link:

In order to use email notifications you should have gmail account and to fill your credentials. All provided private keys, API keys, and gmail credentials are securely stored only on your local machine!

After .env and config.ts are filled you can run the following command:

The above mentioned command will start the application in background mode.

Type in the next command to check the log and verify that everything is working fine

You should see something like this if the application is running and configured correctly

To confirm that everything works, you can open your browser at http://localhost:9003/api/v1/info and the response should be similar to this one:

Last step is to open this link https://network.jelly.market/api/v1/info/get and confirm that you are connected to the network. If your info is presented there then the process is successful and Butler is up and running.

Stop or Reconfigure Butler

If you want to stop Butler or you jast want to update the configuration use this command:

Then you can open again config.ts and update your configurations. When you are ready you can start Butler:

How to setup Butler manually?

Manual Butler setup supports two options for database. Sqlite and mongoDB. Installation with sqlite is much more simpler and the preferred way for the non-technical users. Setup with sqlite requires less resources on your machine and the only thing that you must change is config file ACTIVE_DB directive and write 'sqlite'. If you decide to use sqlite, you can skip the mongoDB setup step.

This step is optional - mongoDB setup

Now you have to install nodejs from this link - https://nodejs.org/en/download/

npm - node package manager is coming with the nodejs installation

Next step is to install yarn

We will need one more package to start Butler as background process. For this purpose we will use pm2

Once, you have successfully installed mongoDB, nodejs, npm, yarn and pm2 on your system you can clone/download the Butler official distribution from here:

Open Butler download folder - it should have the following structure:

Next step is to install all node packages

Now you should edit config.ts file which is in the root folder of the project.

You can generate Binance API key from your Binance exchange account:

For Cryptocompare API Key you can use this link:

In order to use email notifications you should have gmail account and to fill your credentials. All provided private keys, API keys, and gmail credentials are securely stored only on your local machine!

After config.ts is filled you can run the following command from the project root folder:

This will start the butler software as a background process.

Run the following command to check if Butler is running

You should see some similar output:

If you want to stop Butler background service you can execute

To confirm that Butler is up and running you can open this link on your browser http://localhost:9003/api/v1/info

Last step is to open this link https://network.jelly.market/api/v1/info/get and confirm that you are connected to the network. If your info is presented there then the process is successful and Butler is up and running.

What are the risks?

Butler is automated software and it should be up and running 24/7 as long as you want to participate in the protocol. Risks related to connectivity and hardware:

  • Power outage

  • Internet outage

  • Hardware problem

Next group of problems is related to software and service dependencies:

  • Bug in the Butler software or smart contracts

  • Price provider service outage

  • Lack of connectivity to blockchain

  • Database problem

  • Problem with connecting to rebalancing exchange

  • Hacker attack that can get access to Butler operator node

Market related risks:

  • Too volatile market and big price movement can bring some losses

  • Ghost attack - fake swaps are started, but never finalized - no losses for Butler operator, but funds will be locked for 4 hours in HTLC

  • Slow blockchain transaction speed due to network overload, usually combined with massive price movement

All swaps have a lock period of 24 hours. If Butler is down for some of the above mentioned reasons or some new unexpected bug, every Butler node operator have 24 hours period to recover his/her Butler and no loses will be encountered.

JellySwap team have paid for 3rd party security audit and all of the code for Butler is open source, therefore everyone can check it and run it on his/her own risk.

Last updated

Was this helpful?