Restructured project for V2 refactor: **Structure Changes:** - Moved all V1 code to orig/ folder (preserved with git mv) - Created docs/planning/ directory - Added orig/README_V1.md explaining V1 preservation **Planning Documents:** - 00_V2_MASTER_PLAN.md: Complete architecture overview - Executive summary of critical V1 issues - High-level component architecture diagrams - 5-phase implementation roadmap - Success metrics and risk mitigation - 07_TASK_BREAKDOWN.md: Atomic task breakdown - 99+ hours of detailed tasks - Every task < 2 hours (atomic) - Clear dependencies and success criteria - Organized by implementation phase **V2 Key Improvements:** - Per-exchange parsers (factory pattern) - Multi-layer strict validation - Multi-index pool cache - Background validation pipeline - Comprehensive observability **Critical Issues Addressed:** - Zero address tokens (strict validation + cache enrichment) - Parsing accuracy (protocol-specific parsers) - No audit trail (background validation channel) - Inefficient lookups (multi-index cache) - Stats disconnection (event-driven metrics) Next Steps: 1. Review planning documents 2. Begin Phase 1: Foundation (P1-001 through P1-010) 3. Implement parsers in Phase 2 4. Build cache system in Phase 3 5. Add validation pipeline in Phase 4 6. Migrate and test in Phase 5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
207 lines
6.0 KiB
YAML
207 lines
6.0 KiB
YAML
# MEV Bot Production Configuration - Arbitrum L2 Optimized
|
|
|
|
# Arbitrum L2 node configuration
|
|
arbitrum:
|
|
# Primary RPC endpoint - Use environment variable for security
|
|
rpc_endpoint: "${ARBITRUM_RPC_ENDPOINT}"
|
|
# WebSocket endpoint for real-time L2 message streaming
|
|
ws_endpoint: "${ARBITRUM_WS_ENDPOINT}"
|
|
# Chain ID for Arbitrum mainnet
|
|
chain_id: 42161
|
|
# Aggressive rate limiting for high-frequency L2 message processing
|
|
rate_limit:
|
|
# High throughput for L2 messages (Arbitrum can handle more)
|
|
requests_per_second: 200
|
|
# Higher concurrency for parallel processing
|
|
max_concurrent: 20
|
|
# Large burst for L2 message spikes
|
|
burst: 1000
|
|
# Fallback RPC endpoints for redundancy
|
|
fallback_endpoints:
|
|
- url: "${ARBITRUM_FALLBACK_ENDPOINTS}"
|
|
rate_limit:
|
|
requests_per_second: 100
|
|
max_concurrent: 15
|
|
burst: 500
|
|
- url: "https://arb1.arbitrum.io/rpc"
|
|
rate_limit:
|
|
requests_per_second: 50
|
|
max_concurrent: 10
|
|
burst: 250
|
|
- url: "https://arbitrum.llamarpc.com"
|
|
rate_limit:
|
|
requests_per_second: 75
|
|
max_concurrent: 12
|
|
burst: 375
|
|
- url: "https://arbitrum-one.publicnode.com"
|
|
rate_limit:
|
|
requests_per_second: 60
|
|
max_concurrent: 10
|
|
burst: 300
|
|
- url: "https://arbitrum-one.public.blastapi.io"
|
|
rate_limit:
|
|
requests_per_second: 80
|
|
max_concurrent: 15
|
|
burst: 400
|
|
|
|
# Bot configuration optimized for L2 message processing
|
|
bot:
|
|
# Enable the bot
|
|
enabled: true
|
|
# Ultra-fast polling for L2 blocks (100ms for maximum competitive advantage)
|
|
polling_interval: 0.1
|
|
# Minimum profit threshold in USD (account for L2 gas costs)
|
|
min_profit_threshold: 10.0
|
|
# Gas price multiplier for fast L2 execution
|
|
gas_price_multiplier: 2.0
|
|
# High worker count for L2 message volume
|
|
max_workers: 25
|
|
# Large buffer for high-frequency L2 messages
|
|
channel_buffer_size: 2000
|
|
|
|
# Uniswap configuration optimized for Arbitrum
|
|
uniswap:
|
|
# Uniswap V3 factory on Arbitrum
|
|
factory_address: "0x1F98431c8aD98523631AE4a59f267346ea31F984"
|
|
# Position manager on Arbitrum
|
|
position_manager_address: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
|
|
# Focus on high-volume fee tiers
|
|
fee_tiers:
|
|
- 500 # 0.05% - High volume pairs
|
|
- 3000 # 0.3% - Most liquid
|
|
- 10000 # 1% - Exotic pairs
|
|
# Aggressive caching for performance
|
|
cache:
|
|
enabled: true
|
|
# Short expiration for real-time data
|
|
expiration: 15
|
|
# Large cache for many pools
|
|
max_size: 100000
|
|
|
|
# Production logging
|
|
log:
|
|
# Info level for production monitoring
|
|
level: "info"
|
|
# JSON format for log aggregation
|
|
format: "json"
|
|
# Log to file for persistence
|
|
file: "/var/log/mev-bot/mev-bot.log"
|
|
|
|
# Database configuration for production
|
|
database:
|
|
# Production database file
|
|
file: "/data/mev-bot-production.db"
|
|
# High connection pool for concurrent operations
|
|
max_open_connections: 100
|
|
# Large idle pool for performance
|
|
max_idle_connections: 50
|
|
|
|
# Production-specific settings
|
|
production:
|
|
# Performance monitoring
|
|
metrics:
|
|
enabled: true
|
|
port: 9090
|
|
path: "/metrics"
|
|
|
|
# Health checks
|
|
health:
|
|
enabled: true
|
|
port: 8080
|
|
path: "/health"
|
|
|
|
# L2 specific configuration
|
|
l2_optimization:
|
|
# Enable L2 message priority processing
|
|
prioritize_l2_messages: true
|
|
# Batch processing settings
|
|
batch_size: 200
|
|
batch_timeout: "50ms"
|
|
# Gas optimization
|
|
gas_estimation:
|
|
# Include L1 data fees in calculations
|
|
include_l1_fees: true
|
|
# Safety multiplier for gas limits
|
|
safety_multiplier: 1.5
|
|
# Priority fee strategy
|
|
priority_fee_strategy: "aggressive"
|
|
|
|
# Security settings
|
|
security:
|
|
# Maximum position size (in ETH)
|
|
max_position_size: 50.0
|
|
# Daily loss limit (in ETH)
|
|
daily_loss_limit: 5.0
|
|
# Circuit breaker settings
|
|
circuit_breaker:
|
|
enabled: true
|
|
error_threshold: 5
|
|
timeout: "2m"
|
|
|
|
# DEX configuration
|
|
dex_protocols:
|
|
uniswap_v3:
|
|
enabled: true
|
|
router: "0xE592427A0AEce92De3Edee1F18E0157C05861564"
|
|
priority: 1
|
|
sushiswap:
|
|
enabled: true
|
|
router: "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"
|
|
priority: 2
|
|
camelot:
|
|
enabled: true
|
|
router: "0xc873fEcbd354f5A56E00E710B90EF4201db2448d"
|
|
priority: 3
|
|
balancer_v2:
|
|
enabled: true
|
|
router: "0xBA12222222228d8Ba445958a75a0704d566BF2C8"
|
|
priority: 4
|
|
curve:
|
|
enabled: true
|
|
router: "0x445FE580eF8d70FF569aB36e80c647af338db351"
|
|
priority: 5
|
|
|
|
# Monitoring and alerting
|
|
alerts:
|
|
# Slack webhook for alerts - use environment variable for security
|
|
slack_webhook: "${SLACK_WEBHOOK_URL}"
|
|
# Discord webhook for alerts - use environment variable for security
|
|
discord_webhook: "${DISCORD_WEBHOOK_URL}"
|
|
# Email alerts
|
|
email:
|
|
enabled: false
|
|
smtp_server: "smtp.gmail.com:587"
|
|
username: "your-email@gmail.com"
|
|
password: "your-app-password"
|
|
|
|
# Alert conditions
|
|
conditions:
|
|
- name: "High Error Rate"
|
|
condition: "error_rate > 0.02"
|
|
severity: "critical"
|
|
- name: "Low Profit Margin"
|
|
condition: "avg_profit < min_profit_threshold"
|
|
severity: "warning"
|
|
- name: "L2 Message Lag"
|
|
condition: "l2_message_lag > 500ms"
|
|
severity: "critical"
|
|
- name: "Gas Price Spike"
|
|
condition: "gas_price > 100gwei"
|
|
severity: "warning"
|
|
- name: "Daily Loss Limit"
|
|
condition: "daily_loss > daily_loss_limit"
|
|
severity: "critical"
|
|
- name: "Position Size Limit"
|
|
condition: "position_size > max_position_size"
|
|
severity: "critical"
|
|
|
|
# Environment-specific overrides
|
|
# Set these via environment variables in production:
|
|
# ARBITRUM_RPC_ENDPOINT - Your primary RPC endpoint
|
|
# ARBITRUM_WS_ENDPOINT - Your WebSocket endpoint
|
|
# BOT_MAX_WORKERS - Number of workers (adjust based on server capacity)
|
|
# BOT_CHANNEL_BUFFER_SIZE - Buffer size (adjust based on memory)
|
|
# DATABASE_FILE - Database file path
|
|
# LOG_FILE - Log file path
|
|
# SLACK_WEBHOOK - Slack webhook URL
|
|
# DISCORD_WEBHOOK - Discord webhook URL |