- Template for building Rust-based MEV / frontrunning / sandwich bots.
- Created to learn more about blockchain MEV and Rust.
- Use it as a starting point.
- Rust
- WebSocket node (e.g. QuickNode, Alchemy, ...)
- Hosting near the node (for low latency) (optional)
- Fork it, go crazy.
- Contributions, or error fixes, welcomed via PR.
- Far from complete; a starting point.
- Severe lack of MEV resources, I hope this helps getting started.
- Not all chains expose mempool data.
- Attaining a better understanding of MEV.
- Rust chosen for its performance and multi-threading.
- Websockets for fast transaction detection, mempool access.
- Uniswap V2 routers because they're easy to understand.
- Listens to mempool
- Uses websockets for fastest possible detection
- Asynchronously checks if transactions are made against a specific router
- Make money
- Handle errors
- Add your own logic
- Add your own error handling
- Add your own websocket node
- ... and more
main.rs
is the entry point./abi
contains a few router ABIs I've used- they're uniswap v2 variants
mev1.json
is a custom ABI for a custom MEV contract (will see if I can find the source for this at some point) (not required, but can save gas fees)
- Will release other experiments in the future, need to sanitize repos.