GithubHelp home page GithubHelp logo

ziutop / swaps-liquidator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mycelium-ethereum/swaps-liquidator

0.0 0.0 0.0 476 KB

Home Page: https://swaps-liquidator.vercel.app

Shell 1.09% TypeScript 98.53% Dockerfile 0.38%

swaps-liquidator's Introduction

Mycelium Swaps Liquidator

This keeper will automatically liquidate unhealthy positions in the Mycelium Swaps contracts. It can either be run as a single container, connecting to an external MongoDB database, or the database and keeper can be run together with docker-compose.

Setting up the Environment

To setup the environment, copy the env.example file to .env and set the variables.

Variable Name Description
RPC_URL An url for the JsonHttpProvider to make RPC requests.
LIQUIDATOR_PRIVATE_KEY The private key of the liquidator wallet. This will need to be set in the PositionManager.sol contract. This can be checked by calling the isLiquidator method.
PORT Port which exposes the liquidator
FROM_BLOCK Block number from which the liquidator should start syncing. A good choice would be the block number that the Vault.sol contract was deployed.
VAULT_ADDRESS Address for the Vault.sol contract
POSITION_MANAGER_ADDRESS Address for the PositionManager.sol contract
MAX_PROCESS_BLOCK The maximum number of blocks to process in a single provider.getLogs RPC request. This will be determined by the RPC service. Alchemy's maximum is 2000.
START_CRON The crontab time syntax for how frequently the liquidator should be run
DB_URL

Running with Docker Compose

Setup the environment, then build and run the docker-compose.

docker compose build
docker compose up

Running with External Database

Setup the environment, then build and run the docker container.

docker build -t mycelium-swaps-liquidator .
docker run --env-file .env mycelium-swaps-liquidator

Push image to gcp

docker build -t swaps-liquidator --platform linux/amd64 .
docker tag swaps-liquidator gcr.io/avian-direction-235610/swaps-liquidator:<version>
docker push gcr.io/avian-direction-235610/swaps-liquidator:<version>

swaps-liquidator's People

Contributors

doylio avatar dospore avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.