Files
mev-beta/scripts/create-test-swap.sh
Administrator 65c1005d91 feat(testing): add Anvil fork local testing infrastructure
Complete local testing setup with Anvil fork of Arbitrum mainnet:

Infrastructure:
- Docker Compose orchestration (Anvil, MEV Bot, Prometheus, Grafana)
- Anvil fork configuration with 1-second blocks
- Multi-stage Dockerfile for optimized builds
- Health checks and auto-restart policies

Configuration:
- Comprehensive .env.example with all parameters
- Prometheus metrics collection setup
- Grafana datasource provisioning
- .gitignore to prevent committing secrets

Testing Scripts:
- setup-local-fork.sh: Initialize fork and fund test wallet
- create-test-swap.sh: Generate test swaps for bot detection
- Both scripts include validation and helpful output

Integration Components:
- pkg/sequencer/reader.go: WebSocket reader for pending transactions
  - Worker pool pattern (10 workers)
  - <50ms processing target
  - Front-running capability
  - Auto-reconnection with exponential backoff

- pkg/pools/discovery.go: Pool discovery service
  - UniswapV2-style pools (SushiSwap, Camelot)
  - UniswapV3 pools (multiple fee tiers)
  - Factory contract queries
  - Liquidity filtering

Documentation:
- TESTING.md: Complete testing guide
  - Quick start instructions
  - Testing scenarios
  - Monitoring and debugging
  - Performance benchmarks
  - Troubleshooting guide

This enables safe local testing without deploying to public testnet,
using real Arbitrum mainnet state forked locally with Anvil.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 18:52:56 +01:00

3.0 KiB
Executable File