┌──────────────────────────────────────────────────────────┐
│ Telegram Bot Layer │
│ polymarket_bot_v2.py (6,079 lines) │
│ (commands, menus, notifications, deep-links, digests) │
└───────────────────────┬──────────────────────────────────┘
│
┌─────────────┴──────────────┐
▼ ▼
┌──────────────────┐ ┌──────────────────────┐
│ Per-User │ │ Copy Trade Loop │
│ Monitoring Task │ │ copy_trader.py │
│ monitor.py │ │ 60s polling per │
│ 30s cycle │ │ tracked wallet │
│ │ │ │
│ 8 Pattern │ │ FOK → GTC execution │
│ Detectors │ │ Paper + Live modes │
└────────┬─────────┘ └──────────┬────────────┘
│ │
└──────────┬──────────────────┘
│
┌───────────┴────────────┐
▼ ▼
┌──────────────────┐ ┌──────────────────────────┐
│ Polymarket APIs │ │ SQLite Database │
│ polymarket_api │ │ 14 tables │
│ Gamma API │ │ users, positions, trades │
│ CLOB API │ │ signals, copy_wallets │
│ Google News RSS │ │ referrals, paper, alerts │
│ Builder API hdr │ └──────────────────────────┘
└──────────────────┘
│
▼
┌──────────────────────┐
│ wallet_manager.py │
│ (1,998 lines) │
│ On-chain ops │
│ USDC lifecycle │
│ Builder API │
└──────────────────────┘