Files
mev-beta/.env.production.safe
Administrator 0788bd0b93 feat(safety): add comprehensive production safety documentation
- Created .env.production.safe with all safety settings
  - Conservative profit thresholds (0.05 ETH min)
  - Strict risk limits (1 ETH max position, 10 ETH daily)
  - Circuit breaker configuration
  - Emergency stop mechanisms
  - Dry-run mode for testing

- Created PRODUCTION_DEPLOYMENT_GUIDE.md (20+ pages)
  - 4-phase deployment sequence (dry-run → testnet → micro-test → scale-up)
  - Safety mechanisms documentation
  - Monitoring requirements
  - Infrastructure requirements
  - Troubleshooting guide
  - Legal/compliance warnings

- Created SAFETY_CHECKLIST.md (quick reference)
  - Pre-deployment checklist
  - Daily/weekly monitoring tasks
  - Emergency procedures
  - Capital scale-up guidelines
  - Red flags and stop criteria

Safety Features:
 Dry-run mode (simulation only)
 Circuit breaker (3 consecutive losses / hourly loss limits)
 Emergency stop file-based kill switch
 Position size limits
 Daily volume limits
 Slippage protection (1% max)
 Gas price limits (50 gwei max)
 Rate limiting (max trades per hour)

Production Status: TESTING PHASE - Safe for small-scale testing only

Next Steps:
1. Follow deployment guide Phase 1 (dry-run for 24+ hours)
2. Validate profit calculations
3. Test circuit breaker
4. Test on testnet before mainnet

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 22:58:14 +01:00

206 lines
6.1 KiB
Plaintext

# MEV Bot V2 - Production Safety Configuration
# ================================================
# DO NOT deploy without reviewing ALL settings below
# This configuration prioritizes safety over profitability
# ================================
# BLOCKCHAIN CONNECTION
# ================================
# CRITICAL: Use archive RPC provider for production
RPC_URL=https://arb-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY
WS_URL=wss://arb-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY
SEQUENCER_WS_URL=wss://arb1.arbitrum.io/ws
CHAIN_ID=42161
# ================================
# WALLET CONFIGURATION
# ================================
# WARNING: Protect this key - use hardware wallet for large funds
PRIVATE_KEY=your_private_key_here
# EXECUTOR CONTRACT: Set to your deployed flashloan contract address
# Leave as 0x0 if not using flashloans
EXECUTOR_CONTRACT=0x0000000000000000000000000000000000000000
# ================================
# SAFETY MODE
# ================================
# DRY RUN: Set to "true" for simulation-only (NO REAL TRANSACTIONS)
# ONLY set to "false" after thorough testing
DRY_RUN_MODE=true
# EXECUTION: Disable actual execution until validated
ENABLE_EXECUTION=false
# SIMULATION: Always keep enabled for safety checks
ENABLE_SIMULATION=true
# FRONT-RUNNING: Disable until profit calculations validated
ENABLE_FRONT_RUNNING=false
# ================================
# PROFIT THRESHOLDS (Conservative)
# ================================
# Minimum profit required (in wei): 0.05 ETH = very conservative
MIN_PROFIT_WEI=50000000000000000
# Minimum ROI: 5% = conservative (rejects marginal opportunities)
MIN_ROI=0.05
# Minimum swap amount to consider (in wei): 0.1 ETH
MIN_SWAP_AMOUNT=100000000000000000
# Minimum pool liquidity (in wei): $50,000 equivalent
MIN_POOL_LIQUIDITY=50000000000000000000000
# ================================
# RISK LIMITS (Strict)
# ================================
# Maximum position size per trade: 1 ETH = very conservative
MAX_POSITION_SIZE=1000000000000000000
# Maximum daily trading volume: 10 ETH = strict daily limit
MAX_DAILY_VOLUME=10000000000000000000
# Maximum slippage tolerance: 1% = strict (prevents sandwich attacks)
MAX_SLIPPAGE_BPS=100
# Maximum gas limit per transaction: 1.5M gas
MAX_GAS_LIMIT=1500000
# Maximum gas price: 50 gwei (prevents overpaying during spikes)
MAX_GAS_PRICE_GWEI=50
# ================================
# CIRCUIT BREAKER THRESHOLDS
# ================================
# Stop trading after this many consecutive losses
MAX_CONSECUTIVE_LOSSES=3
# Stop trading if hourly loss exceeds this (in wei): 0.1 ETH
MAX_HOURLY_LOSS=100000000000000000
# Stop trading if daily loss exceeds this (in wei): 0.5 ETH
MAX_DAILY_LOSS=500000000000000000
# Cooldown period after circuit breaker trips (seconds): 1 hour
CIRCUIT_BREAKER_COOLDOWN=3600
# ================================
# GAS STRATEGY (Conservative)
# ================================
# Gas price strategy: "safe" = lower gas, slower inclusion
# Options: safe, standard, fast, ultra
GAS_PRICE_STRATEGY=safe
# Gas price multiplier: 1.0 = no markup (safer)
GAS_PRICE_MULTIPLIER=1.0
# ================================
# EXECUTION SETTINGS
# ================================
# Use private RPC for transaction submission (reduces MEV risk)
USE_PRIVATE_RPC=false
PRIVATE_RPC_URL=
# Transaction confirmation blocks: 1 for Arbitrum
CONFIRMATION_BLOCKS=1
# Transaction timeout: 2 minutes
TX_TIMEOUT_SECONDS=120
# Maximum retries for failed transactions
MAX_TX_RETRIES=2
# ================================
# ARBITRAGE DETECTION
# ================================
# Maximum hops in arbitrage path: 2 = simple, safer
MAX_HOPS=2
# Maximum paths to evaluate per opportunity: 50 = focused
MAX_PATHS=50
# Maximum concurrent opportunity evaluations: 5 = conservative
MAX_CONCURRENT_DETECTION=5
# ================================
# POOL DISCOVERY
# ================================
# Maximum pools to discover and monitor: 100 = focused set
MAX_POOLS_TO_DISCOVER=100
# Pool discovery interval (seconds): 5 minutes
POOL_DISCOVERY_INTERVAL=300
# ================================
# PERFORMANCE
# ================================
# Worker count for parallel processing: 4 = moderate
WORKER_COUNT=4
# Buffer size for event processing: 100
BUFFER_SIZE=100
# ================================
# MONITORING & ALERTS
# ================================
# Metrics server port
METRICS_PORT=9090
# Enable detailed logging
LOG_LEVEL=info
# Alert webhook URL (for Slack/Discord/Telegram)
ALERT_WEBHOOK_URL=
# Alert on circuit breaker trip
ALERT_ON_CIRCUIT_BREAKER=true
# Alert on large loss (threshold in wei): 0.05 ETH
ALERT_LOSS_THRESHOLD=50000000000000000
# ================================
# EMERGENCY CONTROLS
# ================================
# Emergency stop file path - create this file to stop bot immediately
EMERGENCY_STOP_FILE=/tmp/mev-bot-emergency-stop
# Auto-restart after emergency stop (dangerous - keep false)
AUTO_RESTART_AFTER_EMERGENCY_STOP=false
# ================================
# ADDITIONAL SAFETY FEATURES
# ================================
# Require manual confirmation for each trade (testing only)
REQUIRE_MANUAL_CONFIRMATION=true
# Maximum trades per hour: 10 = rate limiting
MAX_TRADES_PER_HOUR=10
# Blacklist pools (comma-separated addresses of problematic pools)
BLACKLISTED_POOLS=
# Whitelist tokens only (comma-separated addresses - empty = allow all)
WHITELISTED_TOKENS=
# ================================
# NOTES FOR PRODUCTION
# ================================
# Before deploying to production:
#
# 1. Set DRY_RUN_MODE=true initially and monitor for 24+ hours
# 2. Verify profit calculations match expected values
# 3. Ensure circuit breaker triggers correctly
# 4. Test emergency stop mechanism
# 5. Set up monitoring/alerting
# 6. Start with minimal position sizes
# 7. Gradually increase limits after validating profitability
# 8. NEVER set ENABLE_EXECUTION=true without thorough testing
#
# Recommended deployment sequence:
# Day 1: DRY_RUN_MODE=true (monitor only)
# Day 2-3: If stable, test with ENABLE_EXECUTION=true but MAX_POSITION_SIZE=0.1 ETH
# Day 4-7: If profitable, increase to MAX_POSITION_SIZE=0.5 ETH
# Week 2+: If consistently profitable, gradually increase limits