Home

Awesome

<img align="right" width="150" height="150" top="100" src="./assets/blueprint.png">

Reaper • ci license solidity

Getting Started

This is grim-reaper: EVM-based on-chain liquidation bot for Aave V3 built with Huff language. Optimized for gas efficiency. This repo doesn't include any off-chain architecture.

Requirements

The following will need to be installed. Please follow the links and instructions.

Quickstart

  1. Install dependencies

Once you've cloned and entered into your repository, you need to install the necessary dependencies. In order to do so, simply run:

pnpm install
forge install
  1. Build & Test

To build and test your contracts, you can run:

forge build
forge test

For more information on how to use Foundry, check out the Foundry Github Repository and the foundry-huff library repository.

Single Liquidation (Optimizer runs: 200)Gas UsedBytecode Size (kB)
Solidity Contract948771.039
Assembly940240.336
Assembly (GrimReaper L2)940600.350 + table
Huff Contract939420.248
Huff Contract (GrimReaper L2)939760.260 + table
Single Liquidation (Optimizer runs: 10_000_000)Gas UsedBytecode Size (kB)
Solidity Contract943011.342
Assembly935080.363
Assembly (GrimReaper L2)935440.377 + table
Huff Contract934380.248
Huff Contract (GrimReaper L2)934720.260 + table

66270 gas is used for the liquidation logic itself on mock Aave v3 pool.

Note: Optimizer runs affects how well the compiler optimizes tests contract as well. So, it affects measurements.

Further Optimization Ideas

Acknowledgements

Disclaimer

These smart contracts are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk.