npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ssv-liquidator

v0.0.8

Published

CLI to work with SSV Network liquidation flow, liquidate and earn SSV tokens in SSV Network.

Downloads

8

Readme

SSV Network Liquidator

GitHub GitHub package.json version

GitHub commit activity GitHub contributors GitHub last commit

GitHub package.json dynamic GitHub package.json dynamic

Discord


The SSV Liquidator node executes liquidations on accounts that do not hold enough balance to pay for their operational fees

The liquidator node performs 2 main processes:
  • 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

Requirements

ETH1 Node and other parameters

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.

Node JS

This installation requires NodeJS on your machine. You can download it here.

Installation

git clone https://github.com/bloxapp/ssv-liquidator.git
cd ssv-liquidator
yarn install

Running the CLI

Option 1: Running with CLI arguments

Help on available CLI actions:
yarn cli --help

Input parameters: node-url (n) = ETH1 node url private-key (pk) = Account private key ssv-network-address (c) = Contract Network Address ssv-network-views-address (c) = Contract Network Views Address gas-price (g) = Gas price, default: low ssv-token-address = The contract address for the SSV token hide-table = Hide/show realtime table node-rate-limit = concurrent requests limit (optional, by default: 10) max-visible-blocks = Max block range to display active clusters (optional, by default: 50000)

yarn cli --node-url=eth.infra.com --private-key=a70478942bf... --ssv-network-address=0x425890f2a5g... --ssv-network-views-address=0x425890f2a5g... --gas-price=slow --ssv-token-address=0x425890f2a5g84hw94...

Example of running the CLI with the minimum requirements:

yarn cli --private-key=a70478942bf...

Option 2: Using an env file

Copy the .env.example file to .env and update .env with your parameters.

Example content below:

NODE_URL=eth.infra.com  
SSV_NETWORK_ADDRESS=0x425890f2a5g...  
SSV_NETWORK_VIEWS_ADDRESS=0x425890f2a5g...  
SSV_TOKEN_ADDRESS=0x425890f2a5g84hw94...  
ACCOUNT_PRIVATE_KEY=a70478942bf...  
GAS_PRICE=medium  
HIDE_TABLE=false
MAX_VISIBLE_BLOCKS=50000

If you saved all the parameters in the .env file you can run:

yarn cli

Development

Run CLI as TypeScript executable

yarn cli

Lint

yarn lint

Restart syncer to sync blocks from the beginning (Clear the database file)

rm data/local.db

Testing

  • TODO

Authors

Troubleshooting

  1. 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 run source ~/.bashrc or source ~/.zshrc. Then you will be able to run yarn cli ... as usual.

    If you want to fix OpenSSL issue in common, follow recommendations: NodeJS v17.0.0 OpenSSL Recommendations

License

MIT License