# ────────────────────────────────────────────────────────────── # hft-elon-bot — Polymarket Elon-tweet sniper (CLOB V2 + pUSD) # Copy to `.env` and fill in. NEVER commit `.env` to git. # ────────────────────────────────────────────────────────────── # Mode: paper (no real orders, log only) or live (real orders via CLOB V2) TRADE_MODE=paper # Logging LOG_LEVEL=info # trace | debug | info | warn | error LOG_PRETTY=true # set false in prod for raw JSON # Storage DB_PATH=./data/bot.db # ─── Polymarket endpoints ───────────────────────────────────── CLOB_HOST=https://clob.polymarket.com GAMMA_HOST=https://gamma-api.polymarket.com POLYGON_RPC_URL=https://polygon-rpc.com # ─── Credentials (live mode only) ───────────────────────────── # Generate via L1 wallet -> createOrDeriveApiKey(); see docs. WALLET_PRIVATE_KEY= CLOB_API_KEY= CLOB_SECRET= CLOB_PASS_PHRASE= # Your Polymarket proxy/Safe wallet address (holds pUSD, not your EOA) POLYMARKET_PROXY_ADDRESS= # ─── Strategy parameters ────────────────────────────────────── # Total bankroll the bot is allowed to use (USD) BANKROLL_USD=200 # Ladder prices (cents -> dollars). Competitors entered 1.5-3.8c. LADDER_PRICES=0.015,0.025,0.035 # How much of per-market budget goes to each ladder step (fractions, sum=1) LADDER_SIZE_SPLIT=0.4,0.3,0.3 # Max USD per single Elon market (across all buckets x all ladder steps) MAX_USD_PER_MARKET=50 # Floor we'd accept for a single order (CLOB V2 enforces per-market `mos`; # this is our own additional floor in USD). MIN_ORDER_USD=1 # Discovery DISCOVERY_POLL_INTERVAL_MS=1000 # Gamma fallback poll interval WS_ENABLED=true # try WebSocket first # Target market filter: only this tweeter (slug substring) TARGET_USER_SLUG=elon-musk # Only snipe markets whose duration is within this range (days). # Note: "2-day" Elon markets (slug like `may-16-may-18`) actually span ~4 # days in Gamma data because of UTC-midnight padding around the window. MARKET_MIN_DAYS=1.5 MARKET_MAX_DAYS=4.5 # Skip if already-best price exceeds this (someone beat us, no edge) FRESH_PRICE_THRESHOLD=0.05 # Risk KILL_SWITCH_MAX_ERRORS=10 # stop bot after N consecutive errors KILL_SWITCH_MAX_DRAWDOWN_USD=100 # stop bot after total losses exceed this