CRITICAL FIXES: 1. Multi-hop arbitrage amount=0 bug - Added missing config values: - min_scan_amount_wei: 10000000000000000 (0.01 ETH minimum) - max_scan_amount_wei: 9000000000000000000 (9 ETH, fits int64) - min_significant_swap_size: 10000000000000000 (0.01 ETH) 2. WebSocket 403 Forbidden error - Documented WSS endpoint issue: - Chainstack WSS endpoint returns 403 Forbidden - Updated ws_endpoint comment to explain using empty string for HTTP fallback ROOT CAUSE ANALYSIS: - The ArbitrageService.calculateScanAmount() was defaulting to 0 because config.MinScanAmountWei was uninitialized - This caused all multi-hop arbitrage scans to use amount=0, preventing any opportunities from being detected (803 occurrences in logs) VERIFICATION: - Container rebuilt and restarted successfully - No 403 Forbidden errors in logs ✓ - No amount=0 errors in logs ✓ - Bot processing swaps normally ✓ DOCUMENTATION: - Added comprehensive log analysis (logs/LOG_ANALYSIS_20251109.md) - Added detailed error analysis (logs/ERROR_ANALYSIS_20251109.md) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
99 lines
2.9 KiB
YAML
99 lines
2.9 KiB
YAML
# MEV Bot Development Configuration
|
|
|
|
# Arbitrum node configuration
|
|
arbitrum:
|
|
# RPC endpoint for Arbitrum node (using public endpoint for development)
|
|
rpc_endpoint: "https://arb1.arbitrum.io/rpc"
|
|
# WebSocket endpoint for Arbitrum node - CRITICAL FIX: Use HTTP instead of WSS to avoid 403
|
|
# The Chainstack WSS endpoint in .env returns 403 Forbidden
|
|
# Using empty string will make bot use RPC endpoint for both HTTP and WS
|
|
ws_endpoint: ""
|
|
# Chain ID for Arbitrum (42161 for mainnet)
|
|
chain_id: 42161
|
|
# Rate limiting configuration for RPC endpoint
|
|
rate_limit:
|
|
# Maximum requests per second (adjust based on your provider's limits)
|
|
requests_per_second: 5
|
|
# Maximum concurrent requests
|
|
max_concurrent: 3
|
|
# Burst size for rate limiting
|
|
burst: 10
|
|
# Fallback RPC endpoints
|
|
fallback_endpoints:
|
|
- url: "https://arbitrum-rpc.publicnode.com"
|
|
rate_limit:
|
|
requests_per_second: 3
|
|
max_concurrent: 2
|
|
burst: 5
|
|
|
|
# Bot configuration
|
|
bot:
|
|
# Enable or disable the bot
|
|
enabled: true
|
|
# Polling interval in seconds
|
|
polling_interval: 5
|
|
# Minimum profit threshold in USD
|
|
min_profit_threshold: 5.0
|
|
# Gas price multiplier (for faster transactions)
|
|
gas_price_multiplier: 1.2
|
|
# Maximum number of concurrent workers for processing
|
|
max_workers: 5
|
|
# Buffer size for channels
|
|
channel_buffer_size: 50
|
|
# Timeout for RPC calls in seconds
|
|
rpc_timeout: 30
|
|
|
|
# Uniswap configuration
|
|
uniswap:
|
|
# Factory contract address
|
|
factory_address: "0x1F98431c8aD98523631AE4a59f267346ea31F984"
|
|
# Position manager contract address
|
|
position_manager_address: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
|
|
# Supported fee tiers
|
|
fee_tiers:
|
|
- 500 # 0.05%
|
|
- 3000 # 0.3%
|
|
- 10000 # 1%
|
|
# Cache configuration for pool data
|
|
cache:
|
|
# Enable or disable caching
|
|
enabled: true
|
|
# Cache expiration time in seconds
|
|
expiration: 300
|
|
# Maximum cache size
|
|
max_size: 1000
|
|
|
|
# Logging configuration
|
|
log:
|
|
# Log level (debug, info, warn, error)
|
|
level: "debug"
|
|
# Log format (json, text)
|
|
format: "text"
|
|
# Log file path (empty for stdout)
|
|
file: ""
|
|
|
|
# Database configuration
|
|
database:
|
|
# Database file path
|
|
file: "data/mev-bot.db"
|
|
# Maximum number of open connections
|
|
max_open_connections: 5
|
|
# Maximum number of idle connections
|
|
max_idle_connections: 2
|
|
# Arbitrage configuration
|
|
arbitrage:
|
|
# Enable or disable arbitrage service
|
|
enabled: true
|
|
# Minimum profit threshold in USD
|
|
min_profit: 1.0
|
|
# Maximum position size in USD
|
|
max_position_size: 1000.0
|
|
# Gas price limit in gwei
|
|
max_gas_price: 100
|
|
# Minimum swap size to trigger arbitrage detection (in wei)
|
|
min_significant_swap_size: 10000000000000000 # 0.01 ETH
|
|
# Minimum scan amount (in wei) - CRITICAL FIX for amount=0 bug
|
|
min_scan_amount_wei: 10000000000000000 # 0.01 ETH minimum
|
|
# Maximum scan amount (in wei) - fits in int64 (max 9.2e18)
|
|
max_scan_amount_wei: 9000000000000000000 # 9 ETH maximum (fits int64)
|