Open sourcing a profitable MEV Arbitrage Bot written in blazing fast Rust.

Overview

Dex Arbitrage - MEV Bot license twitter

Open sourcing a profitable MEV Arbitrage Bot written in blazing fast Rust.

Before Starting

I am a self-taught programmer, a couple of months ago I decided to pick up the challenge of creating a profitable Arbitrage MEV bot. I started coding at the start of June with absolutely 0 prior experience and knowledge in MEV. That being said, this bot is not optimized to it's full potential, I am aware of that, this repo should be used for reference material.

It's also important to note that this bot wouldn't be profitable on a competitive EVM chain like Ethereum, BSC or Solana. This code is profitable on lesser known EVM compatible chains where there is less competition :)

Although you usually wouldn't share a profitable bot, I wanted to share my work and progress so other aspiring searchers could get motivated and use this repo as reference material.

I started this repo with the following goals:

  • Creating a simple functioning Arbitrage Bot
  • To further expand my coding knowledge in Rust & understand MEV strategies better

I can confidently say I succeeded in my goals. That being said, the life of a searcher is a lonely road. I want to make my work public as it is so hard to get into the world of MEV, there is very limited information on the topic and it's hard to know where to start. Not only do I want people to learn from this repo, but I also want to inspire others to get into the world of MEV and better understand it.

I hope my journey inspires you, happy searching!

Features

I simplified and cleaned up the code as much as I could. The bot currently sends 1 ETH when a profitable arbitrage path is found, but there is an optimal input amount function.

  • Query Uniswap pairs
  • Find matching pairs across different exchanges
  • Update pair reserves
  • Find arbitrage opportunities

Examples

Besides the crossed_pairs and query_test functions that are used to test the code. In the "examples" folder I included multiple useful functions for testing, including:

  • View pending transactions in the mempool
  • View pending Uniswap V2 transactions in the mempool
  • Subscribe blocks

Any of these functions can be run using: cargo run --example <name of file>.

Improvements

As mentioned before, I'm aware this bot isn't optimized by any means, some features that could be implemented:

  • A better optimal profit function
  • Estimate an array of profitable tokens instead of 1 by 1
  • Make the execute function more gas efficient

Notice

If any bugs or optimizations are found, feel free to create a pull request. All pull requests are welcome!

Warning

This software is highly experimental and should be used at your own risk. Although tested, this bot is experimental software and is provided on an "as is" and "as available" basis under the MIT license. We cannot guarantee the stability or reliability of this codebase and are not responsible for any damage or loss caused by its use. We do not give out warranties.

Acknowledgments

You might also like...
Blazing fast Pedersen hash implementation for Node.JS

pedersen-fast Blazing fast Pedersen hash implementation for Node.JS Exposes starknet-crypto's implementation written in Rust as WASM package. Usage np

Blazing fast toolkit for developing Starknet contracts.
Blazing fast toolkit for developing Starknet contracts.

Starknet Foundry Blazingly fast toolkit for developing Starknet contracts designed & developed by ex Protostar team from Software Mansion based on nat

Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin.

OPI - Open Protocol Indexer Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin. OPI uses a fork

Tradechain is an open source blockchain designed for fast trading & interoperability for new, existing assets

Tradechain is an open source blockchain designed for fast trading & interoperability for new, existing assets. Help build the future of trading with other Tradians.

A fast, simple and powerful open-source cross platform utility tool for generating strong, unique and random passwords

password-generator-pro A fast, simple and powerful open-source cross platform utility tool for generating strong, unique and random passwords. Feature

An open source Rust high performance cryptocurrency trading API with support for multiple exchanges and language wrappers. written in rust(🦀) with ❤️

Les.rs - Rust Cryptocurrency Exchange Library An open source Rust high performance cryptocurrency trading API with support for multiple exchanges and

Crates - A collection of open source Rust crates from iqlusion

iqlusion crates 📦 This repository contains a set of Apache 2.0-licensed packages (a.k.a. "crates") for the Rust programming language, contributed to

Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend  👁️🦀
Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend 👁️🦀

witnet-rust is an open source implementation of the Witnet Decentralized Oracle Network protocol written in Rust. Components witnet-rust implements ma

[Open Source] Blockchain Decentralized Lightweight VPN in Rust
[Open Source] Blockchain Decentralized Lightweight VPN in Rust

[Open Source] Blockchain Decentralized Lightweight VPN in Rust DCVPN_Rust (Decentralized VPN in Rust) is an open-source initiative started by @anandgo

Owner
null
Bootstrap your MEV bot strategies with a simple boilerplate to build on top of.

MEV Template Designed by DeGatchi. Bootstrap your MEV bot strategies with a simple boilerplate to build on top of. How To Use This Template I wrote an

DeGatchi 404 Jan 8, 2023
Automated Solana tool for quick arbitrage, customizable, with real-time data and wallet integration. Trade responsibly.

Solana Arbitrage Trading Tool The Solana Arbitrage Trading Tool is an automated solution crafted to spot and capitalize on arbitrage opportunities wit

null 43 Mar 12, 2024
Rust client library for Flashbots MEV-Share

Flashbots MEV-Share Client   Rust client library for Flashbots MEV-Share. Based on the MEV-Share specs and the TypeScript reference implementation. Us

null 4 Aug 22, 2023
An MEV back-running template for ethers-rs

MEV price prediction I show how to predict ChainLink price updates from the mempool. For the sake of illustration I work with AAVE V2 price oracles. E

Andrea Simeoni 54 Apr 19, 2023
Mequeue is an executor for MEV bots optimized to be able to process multiple transactions concurrently.

Mequeue Mequeue is an executor for MEV bots optimized to be able to process multiple transactions concurrently. The main goal is to make this executor

null 13 Oct 3, 2023
Tool to retrieve mev-share events data and scan for refunds onchain

MEV-Share Analysis This repository can be used to retrieve historical events sent to mev-share and scan for any refunds that were sent to the users. T

Yash Atreya 7 Nov 30, 2023
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

foundry Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust. Foundry consists of: Forge: Ethe

Georgios Konstantopoulos 5.1k Jan 9, 2023
A blazing fast, type-safe template engine for Rust.

markup.rs A blazing fast, type-safe template engine for Rust. markup.rs is a template engine for Rust powered by procedural macros which parses the te

Utkarsh Kukreti 209 Dec 24, 2022
A low-level assembly language for the Ethereum Virtual Machine built in blazing-fast pure rust.

huff-rs • huff-rs is a Huff compiler built in rust. What is a Huff? Huff is a low-level programming language designed for developing highly optimized

Huff 276 Dec 31, 2022
🥷🩸 Madara is a ⚡ blazing fast ⚡ Starknet sequencer, based on substrate, powered by Rust 🦀

Report a Bug - Request a Feature - Ask a Question ⚡ Madara: Starknet Sequencer on Substrate ?? Welcome to Madara, a blazing fast ⚡ Starknet sequencer

Keep StarkNet Strange 138 Apr 22, 2023