Add Synth Overlay — Polymarket Edge Extension#5
Conversation
- edge.py: compute YES-edge from Synth vs market prob, classify signal (underpriced/fair/overpriced) and strength (strong/moderate/none) - matcher.py: normalize slug from Polymarket URL, infer market type (daily/hourly/range), is_supported() - server.py: Flask API on 127.0.0.1:8765 — GET /api/health, GET /api/edge?slug=... using SynthClient (mock or live) - extension/: MV3 content script on polymarket.com, injects badge + detail card, fetches edge from local server - tests: 26 tests for edge, matcher, server (mock mode) - README: technical doc and run instructions
- analyzer.py: EdgeAnalyzer class with dual-horizon analysis, percentile-based confidence scoring (0-1), signal explanations, and invalidation conditions - server.py: wired through EdgeAnalyzer; API returns confidence_score, explanation, invalidation alongside edge/signal/strength - content.js: slide-out panel with full analysis (why signal exists, what invalidates it, confidence bar); fixed MutationObserver infinite loop; SPA navigation handled via URL polling + slug tracking - content.css: slide-out panel, confidence bar, hover states - tests: 56 total (19 new analyzer tests covering aligned/conflicting/fair signals, confidence scoring, explanations, invalidation, bias detection)
- content.js: capture requestedSlug before fetch, discard response if page slug changed during network round-trip (prevents stale overlay on fast SPA navigation) - analyzer.py: add analyze_range() with range-specific explanation, invalidation, and percentile-based confidence for range markets - server.py: wire analyze_range for range endpoint; range API now returns confidence_score, explanation, invalidation like up/down - matcher.py: remove dead code (redundant conditions, unused constant); broaden hourly detection from hardcoded "6pm" to regex matching any time pattern (e.g. 10am, 3pm) - tests: 63 total — 7 new range analysis tests, broader hourly matcher tests, range server response now asserts analysis fields
- _build_range_explanation: fix "X of X" bug — now correctly shows mispriced count vs total bracket count (e.g. "8 of 11") - Remove unused BracketEdge dataclass - Remove unused 'field' import from dataclasses
…E verification - Position overlay badge fixed top-right (always visible on Polymarket) - Format API timestamps as 'Feb 25, 11:45 PM UTC' in detail card and panel - Add 'Verify the overlay (before recording)' section to README
|
@e35ventura I fixed the issues, please check this demo video . |
…able bar - Side panel (not floating card); Synth tab opens panel - Data & Analysis: market YES, Synth FV, edge %, explanation - Confidence bar: discrete colors (45% amber, not green) - Action bar near trade widget: Up/Down guidance + FV/MKT numbers - Server: accept hourly/daily slugs by pattern (active markets) - README and PR description with demo link
6c98760 to
e7157e8
Compare
@e35ventura Thanks for the detailed feedback and example screenshot. Quick clarification before I iterate:
Current state of this branch:
I will match your example screenshot exactly once I know which parts are required vs nice-to-have. |
…resh - Show Synth Up/Down prices directly below Up/Down buttons - Read live market prices from page DOM (not stale API cache) - Scope DOM reads and button targeting to trade widget - Add manual refresh button in side panel (updates in-place) - Show last-update timestamp in panel footer - Remove old action bar and floating badge approaches
|
thanks for asking for clarifications
|
…dation, no overlay - Remove DOM-scraped Polymarket prices; show only Synth-sourced data - Add Invalidation card to side panel (required by issue entrius#3) - Use API current_time for 'Data as of' timestamp instead of local clock - Confidence bar: 45% renders amber, not green - Remove content.css overlay injection; all UI in native Chrome Side Panel - Simplify content.js to slug extraction only (no DOM price scraping) - Update README to reflect current implementation
|
@e35ventura I just fixed the issues. Would you mind reviewing again? |




Tool Name
Synth Overlay — Polymarket Edge Extension
Summary
Synth Overlay adds a live decision layer to Polymarket Up/Down and range markets using Synth forecasts. It surfaces actionable signals directly in the UI with a side panel and in-context overlay: signal direction, edge %, confidence, and clear reasoning.
This PR also addresses reviewer feedback by:
Demo
Technical Document
The required 1-page technical document is in:
tools/synth-overlay/README.mdIt covers:
Related Issues
Fixes #3 — Synth Overlay: Polymarket Edge Extension
Testing
python -m pytest tools/synth-overlay/tests/ -v)tools/synth-overlay/tests/Test result summary:
63 passed(mock mode)Manual verification summary:
Checklist
tools/synth-overlay/README.mdtools/synth_client.SynthClientfor all Synth API access