Marginfi liquidator
- OS librarires:
sudo apt install build-essential libssl-dev pkg-config unzip - Protoc: https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os;
- Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
To initiate the creation of a new configuration file for the liquidator, execute the following command in your terminal: cargo run -- setup
This command launches a Mini CLI wizard that guides you through setting up a base configuration for the liquidator. During this process, it will also check if you have a MarginfiAccount initialized. If not, it will prompt you to create one. At this stage, the setup will only request the essential variables. For adjusting settings like Minimum Profit, you'll need to manually edit the configuration file afterward.
Copy the src/eva01/bin/env.template to environment specific file and populate environment variables.
Local:cargo run -- run <config.toml>
source src/eva01/bin/prod.env- Optionally Rotate logs:
mv ~/log/liquidator.log ~/log/liquidator.log.$(date +'%Y%m%dT%H%M%S') nohup bash $LIQUIDATOR_SRC_PATH/bin/start.sh ~/.config/mrgn/lq_config.toml >> ~/log/liquidator.log 2>&1 &
Replace <config.toml> with the path to your newly created configuration file. After initiating this command, Eva begins its operation. Please note that it might take a few minutes for Eva to load all the marginfi accounts, including English support, and to be fully operational.
The initial loading phase can take some time, depending on your RPC. Eva will load everything needed into the state, including all Marginfi Accounts. Expect the loading time to be between 1-3 minutes depending on the RPC.
To run eva you need to add configuration variables first.
The following are mandatory to run Eva
RPC_URLThe RPC endpoint URL as a string.YELLOWSTONE_ENDPOINTThe Yellowstone endpoint URL as a string.KEYPAIR_PATHThe wallet keypair for the liquidator. It is a string that is the path of the file containing the Keypair object.SIGNER_PUBKEYThe pubkey corresponding to the keypairLIQUIDATOR_ACCOUNTThe marginfi account corresponding to theSIGNER_PUBKEY