GithubHelp home page GithubHelp logo

memory360 / mevb0t Goto Github PK

View Code? Open in Web Editor NEW

This project forked from araalyn/mevb0t

0.0 0.0 0.0 14 KB

Lightweight on-chain ETH arbitrage bot. Generates arbitrage through sandwich attacks and anti-exploit vectors.

Home Page: https://etherscan.io/address/c0ffeebabe.eth

License: MIT License

Solidity 100.00%

mevb0t's Introduction

c0ffeebabeโ˜• v3.0

MevB0t 3.0

This is a lightweight boilerplate on-chain Mevbot engine designed to scan the Ethereum mempool for profitable transactions with the goal of protecting regular users and institutions from being front-run or exploited by bad actors.

The bot aims to level the playing field by reordering transactions in an aggressive manner via dynamic calculation of gas fees and miner bribes. Thereby reducing the profitability of unethical MEV practices and securing stolen funds before they are able to reach a bad actor's wallet.

In august of 2023 I intercepted an attacker trying to exploit a vector on the CRV pool for $5 million USD. My bot was able to front-run the transaction and secure the stolen funds.

https://cointelegraph.com/news/white-hat-returns-5-million-curve-finance-hack

How it Works

99

  • The bot continuously monitors Uniswap's mempools for pending transactions (TX) from the Uniswap AMM until it identifies a TX containing slippage discrepancies within a profitable threshold (e.g. a hasty large buy order, or exploit TX)

  • Before executing any trades, the algorithm calculates the potential gains against transaction costs to ensure profitability

  • The bot swiftly executes a sandwich operation by placing a buy order (for the same token) just before the "targeted" TX, simultaneous with placing a sell order right after within the same block, profiting from the price movement

  • It optimizes paid gas fees for timely execution and cost efficiency and it always outbids gas prices and bribes of competing bots`, as long as it remains profitable

  • Returns ETH back to the contract ready for withdrawal

Features

  • ๐—”๐—ป๐˜๐—ถ-๐—˜๐˜…๐—ฝ๐—น๐—ผ๐—ถ๐˜ (๐˜„๐—ต๐—ถ๐˜๐—ฒ-๐—ต๐—ฎ๐˜) - identifies exploit transactions from bad actors and quickly works to front-run the transaction, effectively securing any stolen funds.

  • ๐—”๐—ฟ๐—ฏ๐—ถ๐˜๐—ฟ๐—ฎ๐—ด๐—ฒ ๐—ข๐—ฝ๐—ฝ๐—ผ๐—ฟ๐˜๐˜‚๐—ป๐—ถ๐˜๐˜† - detects a price discrepancy between decentralized exchanges and executes arbitrage trades, resulting in virtually unlimited potential profit.

  • ๐—™๐—น๐—ฎ๐˜€๐—ต ๐—Ÿ๐—ผ๐—ฎ๐—ป ๐—˜๐˜…๐—ฝ๐—น๐—ผ๐—ถ๐˜๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฃ๐—ฟ๐—ฒ๐˜ƒ๐—ฒ๐—ป๐˜๐—ถ๐—ผ๐—ป - identifies and blocks flash loan exploitations by executing counter trades just before the malicious transactions. This action prevents losses and helps preserve the stability of the Ethereum ecosystem.

  • ๐—Ÿ๐—ถ๐—พ๐˜‚๐—ถ๐—ฑ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฃ๐—ฟ๐—ผ๐˜๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป - proactively identifies liquidation transactions and executes a counter trade to protect vulnerable positions, potentially saving a user or contract from substantial losses, while pocketing the profit.


Instructions

Deploying the contract

  1. Accessing Remix Ethereum IDE
  1. Create or Import Contract File
  • Create a new file in Remix named Contract.sol and paste the code from src/contracts/Contract.sol from this repo.

  • Or download the src/contracts/Contract.sol file from this repo and open it in Remix.

1

  1. Solidity Version and Contract Compilation
  • Navigate to the Solidity Compiler tab.

  • Use Solidity version 0.6.12. In Remix, select this version in the Compiler dropdown.

  • Click on the "Compile" button.

3

  1. Preparation for Deployment
  • Navigate to the "Deploy & Run Transactions" tab.

  • In the "Environment" dropdown, select "Injected Web3". Ensure that MetaMask is installed and activated.

4

  1. Deploying the Contract
  • Click on "Deploy".

  • MetaMask will prompt for transaction confirmation.

5

  1. Confirm Bot Deployment
  • Confirm the bot deployment transaction in MetaMask.
  1. Configuration
  • Copy the botโ€™s contract address and send some Ethereum to its balance for the bot to start. Team recommendation is to fund the bot with a minimum amount of 0.25 ETH.

0.25 ETH is recommended so the bot has enough gas and funds to swap, pay builders, etc.

  • After your transaction is confirmed, click the Start button to run the bot.

  • Press the Stop button to halt bot operations.

  • Withdraw all ETH at any time by clicking the Withdrawal button.

Thatโ€™s it. The bot will start transacting immediately to generate profits from sandwich opportunities on Uniswap transaction pools

โš ๏ธNOTICE: It can take 12-24 HRS to accrue estimated profit potential. This figure is estimated on network congestion and market conditions

Contributions

Contributions to the project are welcome! If you would like to contribute, kindly fork the repository and submit a pull request with your proposed changes or additions. Please ensure that your code adheres to the project's coding standards and includes appropriate tests.

This project would be impossible without generous support from our sponsors and developers. We cannot thank them enough!

Support

If you find the project interesting, please consider granting it a star โญ. Your support is greatly appreciated and helps in motivating further development!

77

FAQ

-
Q: If many people deploy this bot, wouldnโ€™t dilution of profits occur due to competition?

  
+
A: We found that there is no indication of a decrease in

profits when multiple instances of the bot are deployed.

  
-
Q: What average ROI and risks can I expect?

  
+
A: You can find the ROI according to latest data of bot

performances in the "Returns Features" section. This bot

in particular does not create any losses, it only

executes trades when there are proper MEV opportunities

to make profits, so under all circumstances bot operators remain in profit.

  
-
Q: What amount of funds does bot need to work?

  
+
A: Our team recommendation is to fund the bot with a minimum

amount of 0.25 ETH but more than .5 ETH is recommended so

the bot has enough gas and funds to swap, pay builders and tip miners, etc.

  
-
Q: Do I need to keep the Remix page open in my browser while the bot is activated?

  
+
A:No, just save the bot contract address after creating it.

The next time you want to access your bot via Remix,

you need to compile the file again as in step 3.

Now head to `DEPLOY & RUN TRANSACTIONS`, reconnect your

Metamask, paste your contract address into `Load contract

from Address` and press `At Address`

.

https://i.imgur.com/4x2i7RX.png

  

Now it can be found again under "Deployed Contracts".

  
-
Q: Does it work on other chains or DEXes as well?

  
+
A: No, currently the bot is dedicated only for Ethereum on Uniswap mempools.

We aim to expand support for other networks in the future :)

mevb0t's People

Contributors

araalyn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.