The SSV Liquidator node executes liquidations on accounts that do not hold enough balance to pay for their operational fees
- Syncing network contract data Every minute the liquidator node pulls recent balance-determining events for the SSV networks contract and maps all of the network's accounts on the node level to calculate the potential block for liquidation for each account in the network
- Liquidating accounts once the potential liquidation block is reached. The liquidator node will call the liquidate() function in the network contract, if the node was the first to successfully pass the transaction the account will be liquidated and its SSV collateral will be sent to the wallet address which performed the liquidation
In order to be able to fetch all the operators and their status from the contract and react on different events
you need to specify an ETH1 Node URI. If you want to work with a production environment then you must specify eth.infra.com
as the --node-url
parameter for the CLI. As alternative you can set it up in .env
file as the NODE_URL
. Examples below for both scenarios.
If you want to play with the testnet you can register in alchemyapi.io
. Once registered the URL will look like:
https://eth-goerli.alchemyapi.io/v2/<your-token-here>
Review yarn cli --help
output and .env.example
file for all of the parameters required for liquidator to work.
This installation requires NodeJS on your machine. You can download it here.
git clone https://github.com/bloxapp/ssv-liquidator.git
cd ssv-liquidator
yarn install
yarn cli --help
ssv-sync-env (sse) = The SSV sync environment (prod or stage). Default: prod
ssv-sync (ss) = The SSV contract name (format: version.network). Default: v4.prater
node-url (n) = ETH1 node url
private-key (pk) = Account private key
gas-price (g) = Gas price, default: low
hide-table = Hide/show realtime table
max-visible-blocks = Max block range to display active clusters (optional, by default: 50000)
yarn cli --node-url=eth.infra.com --private-key=a70478942bf...
Copy the .env.example
file to .env
and update .env
with your parameters.
Example content below:
NODE_URL=eth.infra.com
ACCOUNT_PRIVATE_KEY=a70478942bf...
GAS_PRICE=medium
HIDE_TABLE=false
MAX_VISIBLE_BLOCKS=50000
SSV_SYNC_ENV=prod # prod or stage, prod - is default value
SSV_SYNC=v4.prater # v4.prater | v4.mainnet (only for prod) | v4.prater (only for prod)
If you saved all the parameters in the .env
file you can run:
yarn cli
yarn cli
yarn lint
rm data/local.db
- TODO
-
Getting
ERR_OSSL_EVP_UNSUPPORTED
error. As a fast solution you can run liquidator as following:NODE_OPTIONS=--openssl-legacy-provider yarn cli ...
Or as alternative you can save this line:
export NODE_OPTIONS=--openssl-legacy-provider
in your~/.bashrc
or~/.zshrc
, and then runsource ~/.bashrc
orsource ~/.zshrc
. Then you will be able to runyarn cli ...
as usual.If you want to fix OpenSSL issue in common, follow recommendations: NodeJS v17.0.0 OpenSSL Recommendations
The ssv-liquidator is licensed under the
GNU General Public License v3.0,
also included in our repository in the LICENSE
file.