This project uses Graph Neural Networks to track transactions happening on-chain. Here's a live demo for you !
The project is a comprehensive one & involves 3 separately working parts linked to each other privately & securely using Lit Actions.
The first part of the project is the dataset generation. The transactions are fetched and labelled as MEV & Non-MEV according to the algo mentioned below :
The architecture for the GNN we are using is as shown :
The second part of AntiMEV involves training the GNN using the dataset generated from Part 1.
The final part is the user side. The trained model is hosted as an API . The user calls the main contract that interacts with the Oracle Contract through Lit Actions again(securely) & the oracle then calls the off-chain GNN with an input which is the tx_hash & the blockNumber that user gave as input and wants to scan it. The output is sent back by oracle using the callback function used in the contract.
Check out below on how to use it.
Well, for this you can directly use this link.
-
Clone the repository
git clone [email protected]:star-gazer111/MEVSpy.git && cd MEVSpy
-
Open a terminal & start the model API
cd GNN && python main.py
-
Start another terminal & test your requests onto the API using CLI.
python predict.py
-
Open another terminal & start LitNode
cd backend && node run_scripts.js
-
Start the training!
cd TrainArbinet && ./run.sh
In case, you get
permission denied
, make the script executable using :chmod +x run.sh
-
Start the frontend
cd App && cd client && cd src && npm i
-
Run!
npm run dev
Be sure to replace the url here with your own endpoint after running the api above.
@article{park2023unraveling,
title={Unraveling the MEV Enigma: ABI-Free Detection Model using Graph Neural Networks},
author={Park, Seongwan and Jeong, Woojin and Lee, Yunyoung and Son, Bumho and Jang, Huisu and Lee, Jaewook},
journal={arXiv preprint arXiv:2305.05952},
year={2023}
}