jelly-swap / jelly-butler-beta

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 notifications. Supported coins are BTC, ETH, DAI, AE, WBTC, USDC.

How to install Butler?

There are two main approaches to install Butler:

  1. Docker Setup

  2. Manual Setup

Docker setup

1. Setup Docker on your system.

3. Configure Butler

Note: All provided private keys, API keys, and gmail credentials are securely stored only on your local machine.

4. Start Butler

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

chmod 777 wait-for.sh (for linux and macOS)

mkdir logs && docker-compose up -d

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

docker-compose logs -f

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

3/19/2020,  16:14:00 info: Starting task: Price Task
3/19/2020,  16:14:01 info: Starting task: Balance Task
3/19/2020,  16:14:04 info: Starting task: Info Task
3/19/2020,  16:14:04 info: Server started on port 9003
3/19/2020,  16:14:04 info: Starting BTC Events
3/19/2020,  16:14:04 info: Starting ETH Events
3/19/2020,  16:14:04 info: Starting ERC20 Events

To confirm that everything works, you can open your browser at http://localhost:9003/api/v1/info

5. Stop or Reconfigure

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

docker-compose stop

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

docker-compose up

Manual Setup

1. Setup MongoDB on your system

1. Install NodeJS

2. Clone or download this repository

git clone https://github.com/jelly-swap/jelly-butler.git

3. Open the downloaded directory

5. Start Butler

After config.ts is filled you can run the following command

pm2 start yarn --name "butler"  -- start

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

pm2 logs

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

3/19/2020,  16:14:00 info: Starting task: Price Task
3/19/2020,  16:14:01 info: Starting task: Balance Task
3/19/2020,  16:14:04 info: Starting task: Info Task
3/19/2020,  16:14:04 info: Server started on port 9003
3/19/2020,  16:14:04 info: Starting BTC Events
3/19/2020,  16:14:04 info: Starting ETH Events
3/19/2020,  16:14:04 info: Starting ERC20 Events

To confirm that everything works, you can open your browser at http://localhost:9003/api/v1/info

6. Stop or Reconfigure Run the following command:

pm2 stop butler

Then you can change config.ts and start it again.

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.

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.

About

License:MIT License


Languages

Language:TypeScript 98.7%Language:Shell 1.0%Language:Dockerfile 0.3%