Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/libevm/subway
A practical example on how to perform sandwich attacks on Ethereum
https://github.com/libevm/subway
Last synced: 6 days ago
JSON representation
A practical example on how to perform sandwich attacks on Ethereum
- Host: GitHub
- URL: https://github.com/libevm/subway
- Owner: libevm
- License: mit
- Created: 2021-12-10T21:01:34.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-02T11:30:53.000Z (over 1 year ago)
- Last Synced: 2024-11-21T06:22:49.556Z (22 days ago)
- Language: Solidity
- Size: 85 KB
- Stars: 2,144
- Watchers: 41
- Forks: 535
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-solidity - libevm/subway - A practical example on how to perform sandwich attacks on Ethereum. (Resources)
- awesome-solidity - libevm/subway - A practical example on how to perform sandwich attacks on Ethereum. (Resources)
- awesome-solidity - libevm/subway - A practical example on how to perform sandwich attacks on Ethereum. (Resources)
README
# Subway
A practical example on how to perform sandwich attacks on UniswapV2 pairs.
Having highly optimized contracts is just one part of the equation, a tech stack is just as important as the contracts to execute on the opportunities.
https://user-images.githubusercontent.com/95674753/145967796-6c2c8925-fb5c-41d4-a64f-a22ce8701ce6.mp4
## Overview
The contracts are written in Yul+ and Solidity, and contains the **bare minimum** needed to perform a sandwich attack (i.e. `swap` and `transfer`). **They do NOT protect against [uncle bandit attacks](https://twitter.com/bertcmiller/status/1385294417091760134) so use at your own risk.**
The goal of this bot is to act as a low barrier of entry, reference source code for aspiring new searchers (hence, JavaScript). This bot contains:
- read from the mempool
- decode transaction data
- simple logging system
- profit calculation algos
- gas bribe calculation
- bundle firing
- misc
- doing math in JS
- calculating next base feeWhile the bot is functional, the bot logic is a very simplistic one and does not contain a lot of the features that many advance searchers have (but not including), such as:
- circuit breakers
- poison token checker
- caching system
- robust logging system (e.g. graphana)
- various gas saving ALPHAsAs such, this bot is intended as a piece of educational content, and not for production use.