Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.64 KB

File metadata and controls

46 lines (34 loc) · 1.64 KB

PolyCopy Implementation Plan

Phase 1: Setup & Target Discovery

  • Initialize project (npm init, tsconfig)
  • Install dependencies (@polymarket/clob-client, ethers, dotenv, typescript, ts-node)
  • Create .env and .env.example templates
  • Create tools/find_target.ts to fetch user address from username
  • Verify find_target.ts works

Phase 2: Core Logic (Skeleton)

  • Create src/main.ts (or bot.ts)
  • Implement DRY_RUN mode flag
  • Implement .env config loading & validation
  • Implement Wallet & Allowance checks
  • Implement WebSocket connection & filtering for Target Address

Phase 3: Sizing & Risk Management

  • Implement calculateSize(targetSizeUSD) logic
  • Implement DAILY_LOSS_LIMIT logic
  • Implement Persistence (load/save today_pnl)

Phase 4: Execution Engine

  • Implement processSignal to handle Buy/Sell signals
  • Implement clobClient.createOrder (commented out for now)
  • Implement "Simulation" logging for Dry Run

Phase 5: Testing & Validation

  • Run dry run simulation
  • Verify logging and math

Phase 6: Nightwatch Dashboard (Frontend)

  • Scaffold React + Vite application in frontend/
  • Install TailwindCSS & Configure "Nightwatch" Theme (Dark/Neon)
  • Add Express & Socket.io to src/main.ts to serve API/Real-time data
  • Create Frontend Components:
    • Stat Cards: Daily PnL, Target Name, Bot Status (Active/Dry Run)
    • Live Feed: Scrolling terminal-like log of actions
    • Positions: Table of copied trades
  • Connect Frontend to Bot via WebSocket
  • Polish UI with animations and responsive design