Skip to content

Implementation of a competitive v2/v3 multi-meat MEV sandwich bot written using Rust and Huff.

License

Notifications You must be signed in to change notification settings

zakirhossen23/rusty-sando

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rusty-Sando (re-write) license

This repo was originally a fork of https://github.com/mouseless-eth/rusty-sando by mouseless

twitter

I am truly grateful to mouseless for his contribution and for introducing us to state of the art MEV & Sandwich bots.


Please note that I will not be actively fixing bugs and addressing issues here.

I might push some critical fixes/improvements if I find time and that is it.

If you desperately need help and are willing to pay for my time (very expensive), you can contact me at [email protected]


A practical example on how to perform V2/V3 and multi-meat sandwich attacks written using Rust and Huff.

The goal of this repo is to act as reference material for aspiring searchers.

This codebase has been cleaned up and rewritten using the Artemis framework. (Further details in pull request #31)

Demo

final_demo.mp4

Brief Explanation

Anytime that a transaction interacts with a Uniswap V2/V3 pool and its forks, there is some slippage introduced (routers, aggregators, other MEV bots). Sandwich bots, like this one, are a toxic form of MEV as they profit off this slippage by frontrunning the transaction pushing the price of an asset up to the slippage limit, and then immediately selling the asset through a backrun transaction.

Bot Logic Breakdown can be found under bot/README.md

Contract Logic Breakdown can be found under contract/README.md

Features

  • Fully Generalized: Sandwich any tx that introduces slippage.
  • V2 and V3 Logic: Logic to handle Uniswap V2/V3 pools.
  • Multi-Meat: Build and send multi-meat sandwiches.
  • Gas Optimized: Contract written in Huff using unconventional gas optimizations.
  • Local Simulations: Fast concurrent EVM simulations to find sandwich opportunities.
  • Token Dust: Stores dust at the end of every bundle for lower gas usage the next time the token is traded.
  • Salmonella Checks: Detect if erc20's transfer function uses any unusual opcodes that may produce different mainnet results.

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

About

Implementation of a competitive v2/v3 multi-meat MEV sandwich bot written using Rust and Huff.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 76.0%
  • Solidity 24.0%