This is an Artemis bot that liquidates aave v3 positions on base chain
-
Install Rust ref
- Install deps:
sudo apt install -y build-essential libssl-dev
(Linux) orxcode-select --install
(Mac)
- Install deps:
-
Install Foundry ref
-
Deploy liquidator contract
cd crates/liquidator-contract
forge install
forge create ./src/Liquidator.sol:Liquidator --private-key <xyz> --rpc-url <xyz>
- Build Rust Application
a. cd to root of project
b. (if not cross compiling) Compile binary for host arch:
cargo build --release
c. (if cross compiling) Compile binary on Mac for Linux: Cross is a tool developed by Rust devs to simplify cross compilation (compiling on one machine architecture for another architecture, e.g.: compile binary on mac for running on a linux machine). Make sure to install from github repo not latest release in cargo (it's quite outdated). Github link
If you are using an ARM based Mac (e.g.: M1), you need to set DOCKER_DEFAULT_PLATFORM env to linux/amd64
cargo install cross --git https://github.com/cross-rs/cross
DOCKER_DEFAULT_PLATFORM=linux/amd64 cross build --target x86_64-unknown-linux-gnu --release
d. Copy (scp) binary to liquidator host
- Run liquidator
./target/release/aave-v3-liquidator --rpc <xyz> --private-key <xyz> --bid-percentage 100 --deployent seashell --liquidator-address <xyz>
forge bind --bindings-path ./crates/bindings-liquidator --root ./crates/liquidator-contract --crate-name bindings-liquidator --overwrite
forge bind --bindings-path ./crates/bindings-aave --root {path to aave-v3-core} --crate-name bindings-aave --overwrite