skill-15-mev-protection
Skill2 starsChanged 6 months agoMITView on GitHub
Protects transactions from MEV via Flashbots, intent-based trading, sandwich attack mitigation, and TWAP orders. Use for high-value swaps, liquidations, or any MEV-exposed on-chain activity.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-web3-agent-core.mdcCursor rule
- .cursor/rules/10-guardrails-first.mdcCursor rule
- .cursor/rules/20-chain-preset-selector.mdcCursor rule
- .cursor/rules/30-simulate-before-send.mdcCursor rule
- skill-01-wallet-managementSkill
- skill-02-smart-contract-interactionSkill
- skill-03-defi-operationsSkill
- skill-04-nft-managementSkill
- skill-05-dao-governanceSkill
- skill-06-cross-chain-bridgeSkill
- skill-07-token-analyticsSkill
- skill-08-security-auditSkill
- skill-09-compliance-amlSkill
- skill-10-identity-didSkill
- skill-11-oracle-data-feedsSkill
- skill-12-gas-optimizationSkill
- skill-13-rwa-tokenizationSkill
- skill-14-social-reputationSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
No revert protection by default — add X-Flashbots-Signature for bundles
- Distinctive: line 54
Prefer intent-based routing for trades > $10,000.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MEV Protection
When to Use
- Executing swaps > $1,000 on public mempools
- Protecting against sandwich attacks
- Submitting liquidation transactions
- Implementing TWAP/VWAP execution strategies
- Using intent-based protocols (CoW Swap, UniswapX)
Prerequisites
- MCP:
blockchain-rpc-server,price-feed-server - Skill-12 for private tx submission
MEV Attack Vectors
| Attack | Mechanism | Mitigation |
| Sandwich | Front-run buy + back-run sell | Private mempool, slippage limits |
| Frontrunning | Copy profitable tx with higher gas | Flashbots bundle, commit-reveal |
| Backrunning | Arbitrage after your tx | Accept (usually harmless) |
| JIT Liquidity | Temporary LP around your swap | TWAP, smaller chunks |
Workflow
1. Private Transaction Submission
Ethereum (Flashbots Protect):
RPC: https://rpc.flashbots.net- No revert protection by default — add
X-Flashbots-Signaturefor bundles - Transactions not visible in public mempool
MEV-Share: Share MEV refund with searchers while maintaining privacy.
2. Intent-Based Trading
| Protocol | Chain | Mechanism |
| CoW Swap | Ethereum | Batch auctions, MEV redistribution |
| UniswapX | Multi | Dutch auctions, filler network |
| 1inch Fusion | Multi | Resolver competition |
Prefer intent-based routing for trades > $10,000.
3. TWAP Execution
For large orders splitting across time:
chunkSize = totalAmount / numChunks
interval = totalDuration / numChunks- Split order into N equal chunks
- Execute each via private RPC with randomized timing (±10%)
- Monitor cumulative slippage vs benchmark price
- Pause if cumulative slippage exceeds threshold
4. Slippage Configuration
| Trade Size | Recommended Slippage | Method |
| < $1K | 0.5% | Public or private |
| $1K–$10K | 0.5–1% | Private mempool |
| $10K–$100K | TWAP 5–10 chunks | Intent or Flashbots |
| > $100K | TWAP + intent protocol | CoW/UniswapX |
Pre-Execution
- Private RPC configured for target chain
- Slippage and deadline set on swap params
- Simulation confirms no revert
- User confirmed if trade > $10,000
References
references/flashbots-setup.mdreferences/intent-protocols.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

