# ================================================================ # POLYMARKET WEATHER PREDICTION TRADING BOT - CONFIGURATION # ================================================================ # Copy this file to .env and fill in your values # ================================================================ # YOUR WALLET (Required) # ================================================================ # Your Polymarket proxy wallet address PROXY_WALLET='0x...' # Private key for signing transactions (keep secret!) PRIVATE_KEY='your_private_key_here' # ================================================================ # DATABASE (Required) # ================================================================ # MongoDB connection string MONGO_URI='mongodb+srv://user:password@cluster.mongodb.net/polymarket_weather' # ================================================================ # BLOCKCHAIN RPC (Required) # ================================================================ RPC_URL='https://polygon-mainnet.infura.io/v3/YOUR_INFURA_KEY' # ================================================================ # POLYMARKET ENDPOINTS (DO NOT CHANGE) # ================================================================ CLOB_HTTP_URL='https://clob.polymarket.com/' CLOB_WS_URL='wss://ws-subscriptions-clob.polymarket.com/ws' USDC_CONTRACT_ADDRESS='0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174' # ============================================================================== # WEATHER TRADING SETTINGS # ============================================================================== # Minimum edge (fair prob - market price) required to trade # 0.12 = 12% edge required (High threshold for safety) WEATHER_EDGE_THRESHOLD=0.12 # Maximum lead days to trade a market (further out = more uncertainty) # Recommended: 3-5 days for lower variance WEATHER_MAX_LEAD_DAYS=5 # Polling interval for day-of observation updates (ms) # 300000 = 5 minutes WEATHER_OBSERVATION_POLL_MS=300000 # Market discovery interval (ms) - how often to search for new markets # 3600000 = 1 hour WEATHER_DISCOVERY_INTERVAL_MS=3600000 # Forecast refresh interval (ms) # 1800000 = 30 minutes WEATHER_FORECAST_REFRESH_MS=1800000 # Dry run mode - compute probabilities but don't execute trades # WEATHER_DRY_RUN: process.env.WEATHER_DRY_RUN === 'true', # Minimum parser confidence to consider a market tradeable (0-1) # Higher = stricter parsing requirements WEATHER_MIN_PARSER_CONFIDENCE=0.8 # ============================================================================== # RISK LIMITS # ============================================================================== # Maximum exposure per individual market (USD) # Conservative: $20 MAX_EXPOSURE_PER_MARKET_USD=20.0 # Maximum exposure per region/city (USD) # Prevents concentration in one geographic area MAX_EXPOSURE_PER_REGION_USD=100.0 # Maximum exposure for markets resolving on same date (USD) # Prevents correlation risk from same-day resolution MAX_EXPOSURE_PER_DATE_USD=50.0 # Maximum Total Open Exposure (USD) # Hard cap on capital at risk at any one time (e.g. 25% of bankroll) MAX_TOTAL_EXPOSURE_USD=250.0 # Maximum daily loss before auto-pause (USD) # Bot will stop trading if daily P&L drops below this (e.g. 5% of bankroll) MAX_DAILY_LOSS_USD=50.0 # Maximum age of weather data before kill-switch triggers (ms) # 3600000 = 1 hour MAX_DATA_AGE_MS=3600000 # ============================================================================== # ORDER SETTINGS # ============================================================================== # Minimum order size in USD MIN_ORDER_SIZE_USD=1.0 # Maximum order size in USD MAX_ORDER_SIZE_USD=10.0 # Maximum slippage tolerance (%) MAX_SLIPPAGE_PERCENT=1.0 # ============================================================================== # NETWORK SETTINGS # ============================================================================== # API request timeout (ms) REQUEST_TIMEOUT_MS=10000 # Number of retries for failed network requests NETWORK_RETRY_LIMIT=3 # Exponential backoff base delay (ms) RETRY_DELAY_BASE_MS=2000 # Maximum retry delay (ms) RETRY_DELAY_MAX_MS=30000 # Cooldown after rate limit detection (ms) RATE_LIMIT_COOLDOWN_MS=120000 # Executor polling interval (ms) EXECUTOR_POLL_INTERVAL_MS=5000 # Random jitter to add to polling (ms) MONITOR_POLL_JITTER_MS=1000 # ============================================================================== # STOP-LOSS / TAKE-PROFIT SETTINGS (Optional) # ============================================================================== # Automatically sell positions when they hit thresholds # Enable stop-loss (sell when position drops below threshold) STOP_LOSS_ENABLED=true STOP_LOSS_PERCENT=25 # Enable take-profit (sell when position rises above threshold) TAKE_PROFIT_ENABLED=true TAKE_PROFIT_PERCENT=50 # Enable trailing stop (lock in gains as price rises) TRAILING_STOP_ENABLED=true TRAILING_STOP_PERCENT=15 # How often to check positions for SL/TP triggers (ms) POSITION_CHECK_INTERVAL_MS=60000 # Minimum acceptable price as % of expected (prevents bad fills) SL_TP_MIN_PRICE_PERCENT=50 # ============================================================================== # DISCORD NOTIFICATIONS (Optional) # ============================================================================== # Get notifications in Discord for important bot events # Enable Discord notifications DISCORD_NOTIFICATIONS_ENABLED=false # Discord webhook URL (Server Settings > Integrations > Webhooks) DISCORD_WEBHOOK_URL='' # Bot display name in Discord DISCORD_BOT_NAME='WeatherBot' # Which events to notify DISCORD_NOTIFY_TRADES=true DISCORD_NOTIFY_SL_TP=true DISCORD_NOTIFY_ERRORS=true DISCORD_NOTIFY_STARTUP=true # ============================================================================== # DISCORD BOT (Optional - Interactive Commands) # ============================================================================== # Commands: /stats, /positions, /markets, /exposure, /config, /pause, /resume, /status # Requires creating a Discord Application at https://discord.com/developers # Enable the Discord bot DISCORD_BOT_ENABLED=false # Bot Token (Discord Developer Portal > Your App > Bot > Token) DISCORD_BOT_TOKEN='' # Client ID (Discord Developer Portal > Your App > General Information > Application ID) DISCORD_CLIENT_ID='' # Guild ID (optional - for faster command registration during development) # Get from Discord: Right-click server > Copy Server ID DISCORD_GUILD_ID=''