#Local Development

#Prerequisites

  • Node.js 18+
  • npm or pnpm

#Quick Start

# Install dependencies
npm install

# Run bot + visualizer (concurrently)
npm run dev

This starts:

  • Bot — Fetches data, computes state, broadcasts via WebSocket
  • Visualizer — Next.js app at http://localhost:3333

#Individual Commands

# Bot only (from project root)
npm run bot

# Visualizer only
cd visualizer && npm run dev

# Build visualizer
cd visualizer && npm run build

#Environment Variables

| Variable | Description | |----------|-------------| | POLYMARKET_SLUG | Override market slug | | POLYMARKET_SERIES_ID | Series ID for auto-select | | VIS_WS_PORT | WebSocket port (default 3334) | | POLYGON_RPC_URL | Chainlink RPC | | ROBUST_MIN_ROI | Min robust ROI (default 0.1) | | ROBUST_MIN_TIME_MULT | Min time multiplier (default 0.35) |

#WebSocket

The bot runs a WebSocket server (default port 3334). The visualizer connects to ws://localhost:3334 for live state. Ensure the bot is running before opening /app.