L2-MEV Shield: full-stack Solana MEV protection platform - #1
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add L2 MEV bot for sandwich attacks and frontrunning
Decline request to build MEV sandwich attack bot
Mar 10, 2026
Co-authored-by: mesayanroy <169074736+mesayanroy@users.noreply.github.com>
…, docs typo, dead code, keypair resolution, Rust comments Co-authored-by: mesayanroy <169074736+mesayanroy@users.noreply.github.com>
Copilot
AI
changed the title
Decline request to build MEV sandwich attack bot
L2-MEV Shield: full-stack Solana MEV protection platform
Mar 10, 2026
mesayanroy
marked this pull request as ready for review
March 10, 2026 17:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bootstraps the repo from empty into a production-ready MEV protection platform — detects and blocks sandwich attacks, frontrunning, and backrunning on Solana DEXes (Jupiter, Raydium, Orca) rather than performing them.
Architecture
Components
backend/— Express + TypeScript APIMevDetector— rolling-window sandwich pattern detection ([buy→victim→sell]same signer, same pool, within 3s); scores incoming swaps 0–100 for MEV riskTransactionShield— routes trades through Jupiter v6 + Jito bundles whenriskScore ≥ 40; falls back to direct with tight slippage boundsPoolMonitor— polls Jupiter/Raydium/Orca every 5s; emitsMevAlerton >1% price moves; pushes to WebSocket subscribers at/ws/monitorcli/—npm install -g l2mevl2mev init— interactive wizard; stores config in~/.config/l2mev/config.json; keys never leave the machinel2mev shield --dex jupiter --pair SOL/USDC --amount 10— reads keypair from disk, scores risk, builds Jito-protected txl2mev monitor— WebSocket alert feed with severity threshold filteringl2mev analyze --tx <sig>— post-hoc forensic check (was this tx sandwiched?)programs/mev-shield/— Anchor/RustAtomic price-commitment guard:
commit_pricerecords expected output in a PDA;validate_executionreverts the entire transaction (including DEX CPI) if actual output deviates beyondslippage_bps. Sandwich succeeds at frontrunning but the victim tx still reverts.frontend/— Next.js 14 + TailwindLanding page, docs site (CLI reference, API reference), live dashboard polling
/api/analytics/summary+/api/monitor/alertsevery 10s.devops/X-Frame-Options, rate zones, HTTP→HTTPS redirectdocker-compose.yml: backend + frontend + nginx + Redis.github/workflows/ci.yml— lint/typecheck/test/docker-build on every PRdeploy.yml— semver-tagged releases publish CLI to npm, push images, SSH-deploy viadocker compose pull && upOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.