{"id":13620103,"url":"https://github.com/libevm/subway","last_synced_at":"2025-05-15T11:06:05.527Z","repository":{"id":37995618,"uuid":"437113064","full_name":"libevm/subway","owner":"libevm","description":"A practical example on how to perform sandwich attacks on Ethereum","archived":false,"fork":false,"pushed_at":"2023-08-02T11:30:53.000Z","size":87,"stargazers_count":2198,"open_issues_count":4,"forks_count":536,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-04-14T19:57:04.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libevm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-10T21:01:34.000Z","updated_at":"2025-04-14T14:02:59.000Z","dependencies_parsed_at":"2024-08-01T21:53:47.800Z","dependency_job_id":null,"html_url":"https://github.com/libevm/subway","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libevm%2Fsubway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libevm%2Fsubway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libevm%2Fsubway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libevm%2Fsubway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libevm","download_url":"https://codeload.github.com/libevm/subway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328385,"owners_count":22052632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:00:52.258Z","updated_at":"2025-05-15T11:06:05.503Z","avatar_url":"https://github.com/libevm.png","language":"Solidity","funding_links":[],"categories":["Resources","Solidity"],"sub_categories":[],"readme":"# Subway\n\nA practical example on how to perform sandwich attacks on UniswapV2 pairs.\n\nHaving 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.\n\nhttps://user-images.githubusercontent.com/95674753/145967796-6c2c8925-fb5c-41d4-a64f-a22ce8701ce6.mp4\n\n## Overview\n\nThe 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.**\n\nThe 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:\n\n- read from the mempool\n- decode transaction data\n- simple logging system\n- profit calculation algos\n- gas bribe calculation\n- bundle firing\n- misc\n  - doing math in JS\n  - calculating next base fee\n\nWhile 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:\n\n- circuit breakers\n- poison token checker\n- caching system\n- robust logging system (e.g. graphana)\n- various gas saving ALPHAs\n\nAs such, this bot is intended as a piece of educational content, and not for production use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibevm%2Fsubway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibevm%2Fsubway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibevm%2Fsubway/lists"}