How to detect sandwich attacks on Elysium in 2026

Elysium runs on a single sequencer with no public mempool, yet automated bots still executed more than 24,000 sandwich attacks and extracted hundreds of thousands of dollars from DEX traders around its mainnet launch. How does value extraction happen when pending transactions stay hidden from public view and how can developers prove it using raw chain data?
Short answer: download every Swap log from an Elysium archive endpoint, flag a buy and a sell on the same pool within 30 seconds with another trade in the buy’s direction between them, trace both bot transactions with debug_traceTransaction to get the bot’s profit, and replay each victim’s swap with eth_simulateV1 without the front-run to measure the loss. On Elysium mainnet data up to November 12, 2026 (block 5,614,749) this found 24,218 sandwiches, $295K lost by victims and $163K kept by bots after gas (Elysium sandwich report).
This guide walks through the mechanics behind transaction ordering on Elysium and breaks down the zero-dependency Python pipeline in the elysium-sandwich-report repository. Using Chainstack archive endpoints for Elysium and HyperEVM, you will see how to decode swap logs, trace bot profits with debug_traceTransaction, simulate exact victim losses via eth_simulateV1 and generate an auditable onchain report. For the full list of supported methods, see Elysium methods.
Prerequisites
Before building the detection pipeline, make sure the following tools and infrastructure are available:
- Python 3.12 or later: The programming environment used by the detection scripts
- uv: Python package and project manager used to run the repository
- Elysium mainnet RPC endpoint: An archive endpoint with access to
debug_*methods - HyperEVM RPC endpoint: An endpoint with full log history for inspecting delayed inbox transactions
The implementation uses Python’s standard library for its RPC client and processing logic. The repository does not require additional Python dependencies.
What are sandwich attacks?
A sandwich attack is a pair of trades placed right before and right after a victim’s swap in the same pool: the bot’s buy pushes the price up, the victim buys at the worse price, and the bot sells into it for a profit.
⏩ Already familiar with MEV attacks and Elysium network architecture? Jump to the “Build the report” section below to dive straight into code.
Imagine a trader submits a large token swap on a decentralized exchange. Before that transaction gets confirmed in a block, it sits in the public mempool where anyone watching the network can see the exact trade size, the target liquidity pool and the slippage tolerance. Automated bots monitor that mempool around the clock to spot a swap large enough to move the pool price then wrap two transactions right around it in a three-step sequence:
- Front-run: The bot submits an identical buy order with a higher gas fee so validators execute it right before the trader’s swap, pushing the token price up
- Victim swap: The trader’s swap executes next against that newly inflated pool price, receiving fewer tokens than originally quoted
- Back-run: Immediately after the trader’s swap clears, the bot sells the tokens acquired in step one back into the same pool at the higher price, pocketing the spread minus gas costs
For this three-step sequence to turn a profit, the price jump created by the front-run and victim swap has to outweigh the DEX swap fees and gas spent on two transactions. High slippage tolerances are what hand bots that margin. When a trader leaves slippage wide open, the bot can push the price right up to that limit without causing the victim’s transaction to revert.
Sandwiching is one of several extraction strategies that happen when transaction ordering is left open to the highest gas bidder. For a deeper breakdown of how these attacks operate across different networks and the mechanisms used to mitigate them, check out the MEV protection guide.
Sandwich attacks on Elysium
Elysium is an Arbitrum Orbit chain built by Kinetiq using the Arbitrum Nitro stack, settling to HyperEVM and using HYPE for gas. It operates with a single sequencer and no public mempool. See Kinetiq’s docs for the architecture.
If Elysium has no public mempool, how can a sandwich attack even happen?
On networks like Ethereum, external bots scan the public mempool to spot pending swaps. Elysium has a single sequencer and no public mempool, so pending transactions aren’t broadcast the same way. Even so, the report below shows bots still saw victims’ trades before they reached a block. How they saw them isn’t established.
Removing public mempool visibility doesn’t stop a bot that sees the swap some other way. Any entity with visibility into incoming order flow or influence over sequencer ordering can still spot a large swap before finalization and place a front-run and back-run around it inside the exact same block.
On top of that, low HYPE gas fees keep the cost of executing two extra transactions minimal. Even a moderate price movement on a DEX swap can cover gas costs and turn a profit when a trader leaves slippage loose. Elysium rolled out with a private mainnet for early-access trading before opening to the public on November 9, 2026 and automated bots sandwiched thousands of trades across that window. Because pending transactions stay hidden prior to block confirmation, auditing confirmed blocks for that three-transaction footprint is the primary way to measure what happened onchain.
How much value was extracted?
When Elysium opened as a private mainnet for early-access trading, bots hit incoming swaps at roughly 160 sandwiches per hour. Once the network went public on November 9 at 13:00 UTC, that pace dropped to about 5 sandwiches per hour. Almost all of the damage occurred before the public launch. Up to block 5,614,749 (November 12, 2026, 23:59 UTC):
- Total sandwiched volume: $7.9M across 32,781 trades from 6,968 wallets inside 24,218 sandwich bundles
- Pre-launch vs. post-launch split: $295K (4,054 HYPE) lost in total with nearly all of it occurring during the private mainnet phase and only $3.8K lost across 391 sandwiches after the November 9 public launch
- Victim impact: The median sandwiched trade lost 3.4% of its value while 16% of attacks stripped 10% or more from the swap
- Operator profits: Bots kept $163K (2,235 HYPE) after gas costs, capturing 55% of total victim losses

Even without a public mempool, bots read pending swaps routed through the HyperEVM inbox or acted ahead of sequencer inclusion. Measuring these onchain losses gives builders the baseline needed to enforce tighter slippage defaults and protect trader execution.
What the report measures
Protection starts with measurement. Rather than guessing whether a DEX pool is affected, the repository reconstructs every sandwich bundle directly from confirmed Elysium block data, identifying which operators ran the attacks, how much victims lost and which liquidity pools took the heaviest volume.
Once the operators, victim wallets and targeted pools are mapped out from raw chain data, protocol teams and wallet builders have concrete numbers to decide where tighter default slippage limits, private order-flow routing or sequencer policy adjustments will make the biggest impact.
These developments make onchain monitoring useful for several reasons:
- Identify recurring attackers: Repeated transaction patterns can connect multiple sandwich attacks to the same operator
- Measure victim losses: Transaction execution data can help estimate the additional value extracted from individual swaps
- Understand transaction ordering: Comparing Elysium blocks with HyperEVM inbox events provides evidence about when an attacker could have observed a victim’s transaction
- Monitor liquidity venues: Launchpads and AMM pools can be examined to identify where attacks are concentrated
- Evaluate ecosystem activity: Historical reports can help establish how sandwich activity changes as liquidity and trading participation evolve
The objective is to move from identifying suspicious transactions individually to building a reproducible dataset of sandwich activity.
Build the report
The report is built by one Python package that downloads swap logs, detects sandwiches, traces bot profit, simulates victim losses and writes an HTML report and a CSV.
💻 Prefer diving straight into the code? Get the report repository on GitHub to explore the source files and run the analysis immediately.
The repository is organized around three top-level directories:
sandwiches/: Downloads logs, detects sandwiches, simulates losses, builds the report and the CSV from chain datadata/sandwiches.csv: One row per detected sandwich containing transaction hashes, operator ID, victim loss and bot profitdocs/index.html: Findings, operators, victims, targets and method published here
Set up the environment
Clone the repository:
git clone https://github.com/chainstacklabs/elysium-sandwich-report.git
cd elysium-sandwich-report
Set up Elysium on Chainstack
Running sandwiches requires two authenticated endpoints.
Why two endpoints?
Elysium produces the transactions that get sandwiched. HyperEVM holds the inbox contract that records messages posted toward Elysium and Elysium’s safe and finalized block tags advance only after a batch lands there. The Elysium endpoint answers what happened inside blocks. The HyperEVM endpoint answers how transactions reached the chain.
- Sign up in the Chainstack Console and create a project
- Deploy an Elysium Mainnet Global Node on a Growth plan or higher so archive data and
debug_*APIs are enabled (Chainstack offersELYSIUMBUILDERSfor 50% off the monthly Growth plan for 3 months) - Deploy a Hyperliquid (HyperEVM) Mainnet node in the same project to obtain the RPC URL


- Copy each node’s HTTPS endpoint from Access and credentials and export the environment variables:
export ELYSIUM_RPC_URL="YOUR_ELYSIUM_ENDPOINT"
export HYPEREVM_RPC_URL="YOUR_HYPEREVM_ENDPOINT"
A quick check to confirm the endpoint points at the right chain:
curl $ELYSIUM_RPC_URL -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
RPC methods used
The README requires debug_* methods on Elysium and full log history on HyperEVM. The table maps the Chainstack-supported Elysium methods to their role in sandwich detection.
| Method | Role in detection |
|---|---|
debug_traceBlockByNumber, debug_traceBlockByHash | Replays a whole block and returns the call tree of every transaction so swaps and token transfers inside routers become visible |
debug_traceTransaction, debug_traceCall | Replays a single transaction or a call, used to inspect one candidate in detail |
eth_getBlockByNumber, eth_getBlockReceipts | Provides transaction order within a block and the logs for every receipt in one call |
eth_getLogs | Reads event logs over a block range which is the method type the HyperEVM inbox scan depends on |
eth_getRawTransactionByHash | Returns the signed transaction bytes, the input needed for hash matching against inbox messages |
eth_sendRawTransactionConditional | Nitro-specific method on the protection side: the sequencer includes the transaction only if the conditions hold |
eth_subscribe (newHeads, logs) | Live block and log delivery over WebSocket |
Tracing on Chainstack covers callTracer, prestateTracer, 4byteTracer, noopTracer, the extended flatCallTracer, muxTracer and erc7562Tracer and stylusTracer, all back to genesis. The Parity-style trace_* and arbtrace_* namespaces are not exposed and return -32601 so flatCallTracer is the replacement for the flat trace format. The trace tutorial shows how to read these traces and the Elysium methods page covers the debug and trace APIs.
The sandwiches package
The sandwiches/ package splits ingestion, time-mapping, detection, simulation and reporting into focused Python modules. Below is a walkthrough of each core file and how its functions fit together.
Build the batched JSON-RPC client
sandwiches/rpc.py: This module handles all JSON-RPC communication with the Chainstack Elysium endpoint, batching calls and enforcing provider block-range limits
Configure endpoint and batch limits
URL = os.environ.get("ELYSIUM_RPC_URL")
BATCH = 50
LOG_RANGE = 10_000
URL: ReadsELYSIUM_RPC_URLfrom the environmentBATCH: Caps each HTTP POST payload at 50 JSON-RPC requests so large block and receipt fetches stay fast without overflowing request limitsLOG_RANGE: Alignseth_getLogspagination to 10,000 blocks per call, the block range limit on Growth and higher plans
Batch and execute RPC calls
def batch(calls):
"""[(method, params)] -> results in order; a failed call returns {'error': message}."""
out = []
for i in range(0, len(calls), BATCH):
chunk = calls[i : i + BATCH]
res = _post([{"jsonrpc": "2.0", "id": j, "method": m, "params": p} for j, (m, p) in enumerate(chunk)])
if isinstance(res, dict):
raise RuntimeError(f"RPC batch error: {str(res.get('error'))[:200]}")
res = sorted(res, key=lambda r: r["id"])
out += [r["result"] if "error" not in r else {"error": str(r["error"].get("message"))[:200]} for r in res]
return out
def call(method, params):
r = batch([(method, params)])[0]
if isinstance(r, dict) and "error" in r:
raise RuntimeError(f"{method}: {r['error']}")
return r
def logs(start, end, topics):
return call("eth_getLogs", [{"fromBlock": hex(start), "toBlock": hex(end), "topics": topics}])
def head():
return int(call("eth_blockNumber", []), 16)
batch is the core transport helper that:
- Slices calls into chunks of 50 and assigns sequential
idvalues - Sends the array via
_post(with built-in retry/backoff) and sorts responses byidso results always match the input order - Surfaces per-call errors cleanly as
{"error": message}instead of crashing an entire batch - Powers
call,logs(wrappingeth_getLogswith hex block bounds) andhead(fetchingeth_blockNumber)
Define chain constants and decode swap logs
sandwiches/chain.py: Stores Elysium Mainnet addresses, milestone timestamps, event topic hashes and the parse_swap decoder
Set token addresses, milestones and event topics
CACHE = os.environ.get("SANDWICH_CACHE", "cache")
NATIVE = "0x0000000000000000000000000000000000000000"
WHYPE = "0xba876237b0f021a6c6d852d6c26e107997cc5e81"
USDC = "0xb47c4c8f73f009cc0c0d3f92b388d13e293f0b65"
STRESS_TEST = (87_023, 142_652) # 2026-10-31 team stress test: dust transfers from 1,000 wallets, no trading
PUBLIC_LAUNCH = 1794229200 # 2026-11-09 13:00 UTC
CUTOFF = 1794528000 # 2026-11-13 00:00 UTC: data ends at the last block before this
V4_SWAP = "0x40e9cecb9f5f1f1c5b9c97dec2917b7ee92e57ba5563708daca94dd84ad7112f"
V3_SWAP = "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"
V2_SWAP = "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822"
V4_INIT = "0xdd466e674ea557f56295e2d0218a125ea4b4f0f6f3307b95f85e6110838d6438"
BIN_SWAP = "0xcad09799f755048f0fd388c6b2fcc8e0cebefd15756c6903522cc2a95f661f70"
LB_SWAP = "0xad7d6f97abf51ce18e17a38f4d70e975be9c0708474987bb3e26ad21bd93ca70"
TRANSFER = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
WETH_DEPOSIT = "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"
WETH_WITHDRAWAL = "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65"
Notice USDC is hardcoded with its exact address: multiple fake USDC tokens exist onchain, so filtering by verified address prevents bogus price calculations. PUBLIC_LAUNCH (1794229200) and CUTOFF (1794528000) anchor the pre-launch vs. post-launch comparison.
Normalize V2, V3 and V4 swap logs
def parse_swap(log):
"""A Uniswap-shaped Swap log -> {pool, z (token0 in), in, out, sender, b, ti, li, tx}, or None."""
t, d = log["topics"], log["data"][2:]
w = [d[i : i + 64] for i in range(0, len(d), 64)]
if t[0] == V4_SWAP: # amounts are the caller's deltas: negative = paid in
pool, sender, a0, a1 = log["address"].lower() + ":" + t[1], t[2], _int256(w[0]), _int256(w[1])
z = a0 < 0
amt_in, amt_out = (-a0, a1) if z else (-a1, a0)
elif t[0] == V3_SWAP: # amounts are the pool's deltas: positive = received
pool, sender, a0, a1 = log["address"].lower(), t[1], _int256(w[0]), _int256(w[1])
z = a0 > 0
amt_in, amt_out = (a0, -a1) if z else (a1, -a0)
elif t[0] == V2_SWAP:
pool, sender = log["address"].lower(), t[1]
i0, i1, o0, o1 = (int(x, 16) for x in w[:4])
z = i0 > 0
amt_in, amt_out = (i0, o1) if z else (i1, o0)
else:
return None
if amt_in <= 0 or amt_out <= 0:
return None
return {
"pool": pool,
"z": z,
"in": amt_in,
"out": amt_out,
"sender": "0x" + sender[-40:],
"b": int(log.get("blockNumber", "0x0"), 16),
"ti": int(log.get("transactionIndex", "0x0"), 16),
"li": int(log.get("logIndex", "0x0"), 16),
"tx": log.get("transactionHash"),
}
parse_swap normalizes three incompatible AMM event schemas into one dictionary:
- Uniswap V4: Identifies the pool by PoolManager address plus pool ID (
t[1]) and treats negative signed deltas as caller input (z = a0 < 0) - Uniswap V3: Identifies the pool by contract address and treats positive signed deltas as pool input (
z = a0 > 0) - Uniswap V2: Reads the four unsigned
uint256in/out words (i0,i1,o0,o1) to determine direction (z = i0 > 0) and exact amounts
It returns a unified record with pool, z, in, out, sender, block b, transaction index ti, log index li and tx hash.
Map blocks to UTC time
sandwiches/clock.py: Elysium’s block cadence varies with load. It solves this by binary-searching eth_getBlockByNumber to find the first block of every UTC hour. See Elysium tooling to learn more.
START = dt.datetime(2026, 10, 19, tzinfo=dt.UTC) # Elysium mainnet block 1
def _first_blocks(targets, head):
"""First block at or after each unix time, by binary search over all targets at once."""
lo, hi = {k: 1 for k in targets}, {k: head + 1 for k in targets}
while any(lo[k] < hi[k] for k in targets):
open_ = [k for k in targets if lo[k] < hi[k]]
mids = {k: (lo[k] + hi[k]) // 2 for k in open_}
blocks = rpc.batch([("eth_getBlockByNumber", [hex(min(mids[k], head)), False]) for k in open_])
for k, blk in zip(open_, blocks, strict=True):
if mids[k] > head or int(blk["timestamp"], 16) >= targets[k]:
hi[k] = mids[k]
else:
lo[k] = mids[k] + 1
return {k: lo[k] for k in targets if lo[k] <= head}
_first_blocks runs binary search across all missing UTC hours simultaneously in batched RPC calls. Once hours.json is cached, the Clock class uses bisect.bisect_right to interpolate the Unix timestamp of any block inside its hour and clock.prices() computes daily median HYPE/USD rates from HYPE/USDC swaps of at least 0.01 HYPE.
Scan historical swap logs
sandwiches/scan.py: Downloads every swap log from block 1 up to CUTOFF (or rpc.head()) into cache/logs/ as gzipped 10,000-block .jsonl.gz files
def uniswap_rows(start, end):
rows = []
for log in rpc.logs(start, end, [[V4_SWAP, V3_SWAP, V2_SWAP, V4_INIT]]):
if log["topics"][0] == V4_INIT: # pool creation: currencies and hook of a V4 pool
d = log["data"][2:]
rows.append(
{
"pool_tokens": log["address"].lower() + ":" + log["topics"][1],
"c0": "0x" + log["topics"][2][-40:],
"c1": "0x" + log["topics"][3][-40:],
"hooks": "0x" + d[152:192],
"b": int(log["blockNumber"], 16),
"li": int(log["logIndex"], 16),
}
)
elif (swap := parse_swap(log)) is not None:
swap["venue"] = "v4" if log["topics"][0] == V4_SWAP else "v2v3"
rows.append(swap)
return rows
run() iterates through 10,000-block chunks (head), skips completed .jsonl.gz files already on disk, combines uniswap_rows with transfer_rows (which reconstructs Bin AMM and Liquidity Book swaps from token transfers), sorts by (b, li) and writes the compressed chunk.
Detect sandwich candidates and classify paths
sandwiches/detect.py: Enforces strict timing, quantity and ordering rules:
WINDOW = 30 # max seconds from the front's block to the back's block
MARGIN = 30 # candidates use interpolated block times; exact timestamps are checked afterwards
QUEUE = 2000 # swaps kept per pool while scanning
TOLERANCE = 0.05 # the back sells within 5% of what the front bought
MAX_VICTIMS = 20
MAX_BETWEEN = 40 # transactions re-run per sandwich when measuring the victims' loss
LIMIT = 0.0001 # a victim "got its minimum" when its output is above an amount in its calldata by at most 0.01%
Match front-run, victim and back-run legs
def _closes(q, x):
"""Indexes of the queued swaps that `x` could close as a back, oldest first: the opposite direction, another transaction, `x` sells within 5% of what it bought, and a third transaction swapped in its direction in between."""
hits, later = [], set()
for i in range(len(q) - 1, -1, -1):
f = q[i]
if f["z"] == x["z"]:
continue
if f["tx"] != x["tx"]:
if abs(x["in"] - f["out"]) <= TOLERANCE * f["out"] and later - {f["tx"]}:
hits.append(i)
later.add(f["tx"])
return hits[::-1]
_closes walks backward through a pool’s recent swap queue q whenever a swap x arrives:
- Skips swaps in the same direction (
f["z"] == x["z"]) - Checks that
xcomes from a different transaction (f["tx"] != x["tx"]) and sells within 5% (TOLERANCE = 0.05) of whatfbought - Requires at least one intervening swap in the same direction as
f(later - {f["tx"]}) so two-legged arbitrage without a victim is excluded
Separate sequencer vs. inbox victims and assign tiers
def victim_paths(found):
"""Each victim's path: the block that executed it read a new delayed message (the inbox) or not (the sequencer)."""
hdr = headers(b for s in found for v in s["victims"] for b in (v["b"], v["b"] - 1))
for s in found:
for v in s["victims"]:
v["path"] = "inbox" if hdr[str(v["b"])][1] > hdr[str(v["b"] - 1)][1] else "sequencer"
same_block = c["front"]["b"] == c["back"]["b"]
if same_block:
tier = "A" if c["back"]["ti"] - c["front"]["ti"] - 1 == len({v["tx"] for v in victims}) else "B"
base = fees[str(c["front"]["b"])]
tf, tv, tk = (effective_tip(t, base) for t in (f, txs[victims[0]["tx"]], k))
tip_signature = tf > tv >= tk
else:
tier, tip_signature = "C", None
This block of detect.py establishes two key proofs:
victim_paths: Compares the Arbitrum block header’s delayed-message count at blockv["b"]againstv["b"] - 1. An increment proves the transaction arrived via the HyperEVM Delayed Inbox rather than direct sequencer submission.- Tier classification: Tags same-block sandwiches with only victim transactions between legs as Tier A, same-block sandwiches with other intervening transactions as Tier B and cross-block sandwiches within the 30-second window as Tier C. For same-block attacks, it also checks whether
effective_tipfollowed the classic priority-ordering pattern (tf > tv >= tk).
sandwiches/__main__.py: Wires the remaining stages together inside measure() and STEPS:
def measure():
"""Trace the bots' transactions, group operators, then price both sides of every sandwich."""
found = load("sandwiches.json")
legs = money.trace(found)
tokens, prices_, clk = load("pool_tokens.json"), load("prices.json"), clock.Clock()
ops = operators.run(found, legs, prices_, clk)
money.profit(found, legs, ops, prices_, clk)
inbox.prove([s for s in found if s["tier"] == "C"]) # an inbox victim's block holds no sequencer transactions
money.count(found)
money.simulate([s for s in found if s["counted"]], tokens, prices_, clk)
for s in found:
s.setdefault("loss", None)
save("sandwiches.json", found)
STEPS = {
"scan": scan.run, # swap logs -> cache/logs
"clock": clock.build, # first block of every UTC hour
"detect": detect.run, # pool tokens, candidates, transaction checks, tiers
"prices": prices, # daily HYPE/USD from Elysium's USDC pools
"measure": measure, # profit from traces, operators, victims' loss from simulation
"rules": rules.run, # how the count changes with the sell window
"venues": venues.run, # swap events of other AMM formats
"report": report.build, # docs/index.html and data/sandwiches.csv
}
Inside measure(), four modules complete the forensic picture:
money.trace()andmoney.profit()(money.py): Callsdebug_traceTransactionon every front-run and back-run leg to extract internal HYPE transfers, execution gas and L1 settlement fees, computing net bot profit in HYPE and USD.operators.run()(operators.py): Groups rotating EOAs and smart contracts into 16 unified operators by linking EOAs to bot contracts, matching runtime bytecode withPUSH20operands zeroed (code_family) and tracing recurring profit recipients.inbox.prove()(inbox.py): QueriesHYPEREVM_RPC_URLforMessageDeliveredevents on Elysium’s bridge contract (0x503d572157113faaad4dbed2647bb10b949216b6) and compares parent-chain timestamps against Elysium front-runs, proving 86% of inbox sandwiches executed after the victim’s message appeared on HyperEVM.money.simulate()(money.py): Callseth_simulateV1at the block before each victim swap, replaying the victim’s calldata without the bot’s front-run in state. Subtracting actual onchain output from counterfactual simulated output yields exact victim loss ($294,843 total; 7.6% of sandwiches failed simulation and count as zero).
Finally, rules.py validates sandwich counts across 2 blocks, 5 s, 15 s and 30 s windows, charts.py renders zero-dependency inline SVGs and report.py plus report.css compile docs/index.html and data/sandwiches.csv.
Monitor
The first run starts at block 1, makes about 7,000 batched requests and takes about 40 minutes. Later runs fetch only new blocks, with the cache stored in cache/. Once the initial 40-minute backfill completes, running the full package again operates as an incremental monitor:
uv run python -m sandwiches
Because scan.py and clock.py track the highest cached block in ./cache/, each run fetches only newly produced blocks up to latest, updates hours.json, checks HYPEREVM_RPC_URL for new MessageDelivered events and appends newly detected sandwiches. For real-time alerting on Chainstack, pair this detector with a WebSocket eth_subscribe("logs", ...) listener targeting Uniswap V4 PoolManager or V2/V3 pairs, then pass suspicious buy-buy-sell triplets within 30 seconds through eth_simulateV1 and debug_traceTransaction.
Read the report
The finished output has two artifacts:
docs/index.html: The readable report, also published at the report site, with sections for findings, operators, victims, targets and methoddata/sandwiches.csv: Holds one row per sandwich with transactions, operator, loss and profit
To regenerate docs/index.html and data/sandwiches.csv purely from local cache without RPC calls:
uv run python -m sandwiches report
Opening docs/index.html displays hourly attack rates before and after the November 9 public launch, the 16-operator leaderboard, router concentration (0x9b60...3333), victim loss distributions and the full methodology, while data/sandwiches.csv provides one row per sandwich for external analysis.
Considerations
When running transaction ordering analysis in production environments, consider the following when adapting the implementation for continuous monitoring or a different Elysium application:
- Archive and
debug_*requirements: Historicaleth_simulateV1anddebug_traceTransactioncalls require an archive-capable node. On Chainstack, archive and debug access start on the Growth plan, while the free Developer plan supports liveeth_getLogsand WebSocket testing. - RPC batch size throttling: Querying receipts one transaction at a time introduces network round-trip latency. Grouping
eth_getTransactionReceiptcalls into controlled batches (for example, 20 to 50 requests per JSON-RPC batch; therpc.pymodule above uses 50) maximizes throughput while respecting node concurrency limits. - Custom searcher contracts and split addresses: Advanced MEV operators frequently deploy smart contracts that execute the front-run from Address A and trigger the back-run from Address B, or route profit directly to a separate treasury address (
toparameter in the Swap event). Extending the heuristic to check the swap’s recipient (thetofield) alongside the transaction’sfromaddress captures obfuscated bot architectures. - Uniswap V3 concentrated liquidity events: While Uniswap V2 pairs emit
Swap(address,uint256,uint256,uint256,uint256,address), Uniswap V3 pools emitSwap(address,address,int256,int256,uint160,uint128,int24)where signed integers (int256) denote token inflows and outflows. The pipeline’sparse_swapalready decodes V2, V3 and V4 swaps; supporting another AMM means adding its Swap event topic and decoding its amounts into the same record. - Block count vs. time windows: Elysium produces multiple blocks per second and adjusts block times under load (Elysium tooling). Compute time windows from block
timestampfields (asclock.pydoes) instead of fixed block intervals. - Contract-level guardrails: Private RPC routing alone isn’t enough, as Chainstack’s MEV protection guide notes: swaps stay exposed if slippage tolerances remain wide. Transactions can also enter through the HyperEVM Delayed Inbox, where they’re public before Elysium executes them (25% of the sandwiches in the report). Applications should enforce tight
amountOutMinimumvalues, short deadlines and, when appropriate,eth_sendRawTransactionConditionalbounds againstl1BlockNumber.
Conclusion
Sandwich attacks on Elysium became a public question during the run-up to the mainnet launch, with conflicting statements about how a suspected bot reached its trades. The elysium-sandwich-report repository answers the measurable parts from chain data: it traces blocks through debug_* methods on an Elysium archive endpoint, measures loss and profit per sandwich, matches victims’ signed transactions against HyperEVM inbox messages and renders the findings into a report and a CSV.
The workflow in short: set the two environment variables, deploy Elysium and HyperEVM nodes on Chainstack, run uv run python -m sandwiches, then open docs/index.html. Teams building on Elysium can add slippage limits, deadlines and conditional transactions to the contracts that the report shows as most targeted.
Frequently asked questions
Elysium is an Arbitrum Orbit chain that settles to HyperEVM. While the Elysium endpoint provides block ordering, swap logs and execution traces, users can also submit transactions through the Delayed Inbox contract on HyperEVM. Querying HyperEVM for MessageDelivered events lets the pipeline match parent-chain timestamps against Elysium execution blocks and prove when bots reacted to pending inbox transactions.
Traders and MEV operators route swaps through a wide mix of entry points, including Uniswap Universal Routers, aggregators and custom bot contracts with proprietary calldata layouts. Regardless of which contract initiates the trade, the underlying liquidity pool emits a standardized Swap event log, giving the detector a uniform record of token directions, exact amounts and pool addresses.
Instead of estimating price impact from static reserve formulas, money.py calls eth_simulateV1 against the state immediately preceding the bot’s front-run block. It replays the victim’s exact transaction calldata without the bot’s front-run present then subtracts the tokens the victim actually received onchain from the simulated counterfactual output.
Yes. Once the initial backfill completes and populates ./cache/, running uv run python -m sandwiches checks the highest cached block height and fetches only newly produced blocks up to the latest chain tip. For sub-second alerting, you can pair the detection logic with a Chainstack WebSocket eth_subscribe listener watching Swap topics in real time.
The historical simulation and tracing stages rely on eth_simulateV1 and debug_traceTransaction across past blocks, which require an archive-capable node. On Chainstack, archive access and debug_* namespaces are available starting on the Growth plan, whereas live log filtering (eth_getLogs) and WebSocket subscriptions work on the free Developer plan.
Related reading
- What is Elysium
- Elysium vs HyperEVM: fees, speed, finality and RPC
- What is MEV protection? Ethereum, Base, Arbitrum, Arc
- Elysium methods (Chainstack docs)
- Elysium tooling (Chainstack docs)