# libevm/subway

A practical example on how to perform sandwich attacks on Ethereum

Repository: https://github.com/libevm/subway
Canonical: https://ross.abutalabs.com/products/libevm-subway
Language: Solidity
License: MIT
License Family: permissive
Last push: 2023-08-02T11:30:53+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 1727, "days_push": 1127, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2207, forks 525 (observed 2026-08-28T04:06:26.083227+00:00)

## What it is
An educational reference implementation showing how to perform sandwich attacks on UniswapV2 pairs on Ethereum. It combines Yul+/Solidity contracts with a JavaScript bot that reads the mempool, decodes transactions, calculates profit and gas bribes, and fires bundles.

## Use cases
- learn how MEV sandwich attacks work on Ethereum
- understand how to read and decode mempool transactions
- study a minimal sandwich bot implementation in Solidity and JavaScript
- learn how to calculate gas bribes and fire Flashbots bundles
- get a starting point for building MEV searcher bots
- see how UniswapV2 pair swaps can be exploited for profit

## When to choose
- you want to learn MEV and sandwich attack mechanics from working source code
- you need a simple, low-barrier reference for building an Ethereum searcher bot
- you want to see how mempool monitoring and bundle submission fit together

## When to avoid
- you need a production-ready bot with circuit breakers, poison token checks, and robust logging
- you want protection against uncle bandit attacks
- you need optimized gas usage or advanced searcher features

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: blockchain, chatbot
- domain: blockchain, education
- platform: -
- tags: mev, sandwich-attacks, uniswap-v2, solidity, yul, flashbots, searching, educational, transaction-monitoring, mempool, cryptocurrency, trading, nodejs, ethereum

## Member repositories
- libevm/subway (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:26.083227+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:46:28.229827+00:00, confidence not recorded.
  - readme: https://github.com/libevm/subway (fetched 2026-08-28T04:06:26.083227+00:00, sha 9ef34ec5a76a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
