Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.71 KB

README.md

File metadata and controls

43 lines (29 loc) · 1.71 KB

Fuse by Rari Capital: Liquidator Bot

This repository contains the JavaScript source code for the Fuse Liquidator Bot. See here for the Fuse dApp, here for the Fuse SDK, or here for the Fuse contracts.

How it works

When running a Fuse pool, you need a bot to liquidate unhealthy loans. Fortunately, Fuse's Safe Liquidator contract allows liquidators to safely liquidate loans on any Fuse Pool by confirming on-chain that the liquidator will not lose money on each liquidation, so you will likely have external liquidators working for you. However, you may want to spin up a liquidator bot for profit or to improve the efficency of your own pool(s). Note that liquidations require ETH for gas, but you can set a minimum profit amount for your liquidations.

Installation

You'll want to run the script on the latest Node.js LTS (tested with v12.16.1) with the latest version of NPM.

Install PM2 (process manager) globally: npm i -g pm2

Install fuse-liquidator-bot dependencies: npm i or npm install

Usage

  1. Configure your environment in ecosystem.config.js and .env

With Docker:

>>> docker run -it --env-file .env ghcr.io/midas-protocol/fuse-liquidator-bot:main

With plain js:

  1. Build
>>> npm run build
  1. Start the rebalancer with PM2, or Docker
>>> pm2 start ecosystem.config.js  # (for production usage, add `--env production`)
  1. Stop, check status and logs:
>>> pm2 stop ecosystem.config.js
>>> pm2 list
>>> cat ~/.pm2/logs