Vesu Liquidator ๐ค is an automated bot that monitors positions on the Vesu Protocol and liquidates them.
Under the hood, the bot calls the vesu-liquidate contract made by the Vesu team.
You can run the Vesu Liquidator using our pre-built Docker image. Here's how to use it:
- Pull the latest image:
docker pull ghcr.io/astraly-labs/vesu-liquidator:latest
- Run the container:
docker run --rm -it \
-v /path/to/your/.env:/app/.env \
ghcr.io/astraly-labs/vesu-liquidator:latest \
--account-address <LIQUIDATOR_ACCOUNT_ADDRESS> \
--network <NETWORK_NAME> \
--rpc-url <RPC_URL> \
--starting-block <BLOCK_NUMBER> \
--pragma-api-base-url <PRAGMA_API_BASE_URL>
--storage-path ./vesu.json
For more options, run:
docker run --rm ghcr.io/astraly-labs/vesu-liquidator:latest --help
If you want to build the Docker image locally:
- Build the Docker image:
docker build -t vesu-liquidator .
- Run the locally built image:
docker run --rm vesu-liquidator --help
#ย OR
docker run --rm -it \
# Optional .env, can also be provided through CLI
-v /path/to/your/.env:/app/.env \
vesu-liquidator \
--account-address <LIQUIDATOR_ACCOUNT_ADDRESS> \
--network <NETWORK_NAME> \
--rpc-url <RPC_URL> \
--starting-block <BLOCK_NUMBER> \
--pragma-api-base-url <PRAGMA_API_BASE_URL>
--storage-path ./vesu.json # persistent indexer storage into a file
In order to run the liquidator, you need the protoc Protocol Buffers compiler, along with Protocol Buffers resource files.
sudo apt update && sudo apt upgrade -y
sudo apt install -y protobuf-compiler libprotobuf-dev
Assuming Homebrew is already installed.
brew install protobuf
Create an .env
file following the example file and fill the keys.
cargo build --release
The executable can be found at ./target/release/vesu-liquidator
.
You can run vesu-liquidator --help
- which will show how to use the bot:
Usage: vesu-liquidator [OPTIONS] --account-address <LIQUIDATOR ACCOUNT ADDRESS> --network <NETWORK NAME> --rpc-url <RPC URL> --starting-block <BLOCK NUMBER> --pragma-api-base-url <PRAGMA API BASE URL>
Options:
--account-address <LIQUIDATOR ACCOUNT ADDRESS>
Account address of the liquidator account
--private-key <LIQUIDATOR PRIVATE KEY>
Private key of the liquidator account
--keystore-path <LIQUIDATOR KEYSTORE>
Keystore path for the liquidator account
--keystore-password <LIQUIDATOR KEYSTORE PASSWORD>
Keystore password for the liquidator account
-n, --network <NETWORK NAME>
The network chain configuration [possible values: mainnet, sepolia]
--rpc-url <RPC URL>
The rpc endpoint url
--config-path <VESU CONFIG PATH>
Configuration file path [default: config.yaml]
-s, --starting-block <BLOCK NUMBER>
The block you want to start syncing from
--pragma-api-base-url <PRAGMA API BASE URL>
Pragma API Key for indexing
--apibara-api-key <APIBARA API KEY>
Apibara API Key for indexing
--pragma-api-key <PRAGMA API KEY>
Pragma API Key for indexing
-h, --help
Print help
./target/release/vesu-liquidator --network mainnet --rpc-url https://starknet-mainnet.public.blastapi.io --starting-block 668886 --pragma-api-base-url https://api.dev.pragma.build --account-address <YOUR_ACCOUNT> --private-key <YOUR_PRIVATE_KEY>
Should run the bot:
โโโ โโโโโโโโโโโโโโโโโโโโโโ โโโ โโโ โโโ โโโโโโโ โโโ โโโโโโโโโโโโโ โโโโโโ โโโโโโโโโ โโโโโโโ โโโโโโโ
โโโ โโโโโโโโโโโโโโโโโโโโโโ โโโ โโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโ โโโโโโโโโ โโโโโโโโโโโ โโโ โโโ โโโโโโ โโโโโโ โโโโโโโโโ โโโโโโโโโโโ โโโ โโโ โโโโโโโโโโโ
โโโโ โโโโโโโโโโ โโโโโโโโโโโ โโโ โโโ โโโโโโโโ โโโโโโ โโโโโโโโโ โโโโโโโโโโโ โโโ โโโ โโโโโโโโโโโ
โโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโ โโโ โโโโโโโโโโโโ โโโ
โโโโโ โโโโโโโโโโโโโโโโ โโโโโโโ โโโโโโโโโโโ โโโโโโโ โโโโโโโ โโโโโโโโโโ โโโ โโโ โโโ โโโโโโโ โโโ โโโ
๐ค Liquidator ๐ 0x42...6c
๐ฏ On Mainnet
๐ฅก Starting from block 668886
2024-08-23T05:29:06.808482Z INFO ๐งฉ Starting the indexer service...
2024-08-23T05:29:06.808583Z INFO โณ Waiting a few moment for the indexer to fetch positions...
2024-08-23T05:29:07.916084Z INFO [๐ Indexer] Found new position 0x156fa1e95830c415
2024-08-23T05:29:16.809509Z INFO ๐งฉ Starting the oracle service...
2024-08-23T05:29:16.833518Z INFO ๐งฉ Starting the monitoring service...
2024-08-23T05:29:16.833561Z INFO [๐ฎ Oracle] Fetching latest prices...
2024-08-23T05:29:16.833667Z INFO [๐ญ Monitoring] Checking if any position is liquidable...
2024-08-23T05:29:20.176390Z INFO [๐ฎ Oracle] โ
Fetched all new prices
2024-08-23T05:29:20.177651Z INFO [๐ญ Monitoring] ๐คจ They're good.. for now...
#ย rest of the execution...
If you want to say thank you or/and support:
- Add a GitHub Star to the project.
- Tweet about it.
- Write interesting articles about the project on Dev.to, Medium or your personal blog.
First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please read our contribution guidelines, and thank you for being involved!
We follows good practices of security, but 100% security cannot be assured. The bot is provided "as is" without any warranty. Use at your own risk.
For more information and to report security issues, please refer to our security documentation.
This project is licensed under the MIT license.
See LICENSE for more information.