marginswap-liquidator

A script that:

  1. collects all accounts that have interacted with the MarginSwap router
  2. filters those accounts down to those that are liquidatable
  3. and liquidates those accounts

Setup

  1. Place a private key in ~/.marginswap-secret
  2. Run npm install
  3. Create a file called .env in the root directory with the following keys in the following format:
NODE_URL=https://yourinfuraoralchemyorsomething.node
CHAIN_ID=1
# set this to the block that the router was initiated
# for avalanche
START_BLOCK=2054306
# for ethereum mainnet
START_BLOCK=9000000

# optional parameters:
# window facto within which to update prices
PRICE_WINDOW=0.1
# minimum loan amount for which to trigger liquidation
MINIMUM_LOAN_USD=5

Usage

npm run liquidate