Skip to content

Task 02h Phase 3: CLOB-based recovery for indexer-failed FFIC fficd-003 markets#9

Merged
MaksymDS merged 1 commit into
masterfrom
task02h-phase3/polygonscan-logs
Apr 27, 2026
Merged

Task 02h Phase 3: CLOB-based recovery for indexer-failed FFIC fficd-003 markets#9
MaksymDS merged 1 commit into
masterfrom
task02h-phase3/polygonscan-logs

Conversation

@MaksymDS
Copy link
Copy Markdown
Contributor

Summary

Phase 3 of FFIC trade-history backfill targeting 2 indexer-failed deadline markets ($269M Iran-by-Apr-30, $174M Ceasefire-by-Apr-7). After 4 unsuccessful approaches (Polygonscan logs, Polygon RPC, The Graph, CLOB /trades), recovered usable data via CLOB /prices-history + data-api /trades in 38 seconds total.

What was recovered

  • Iran Apr30: 28,774 price candles (full history), 4,000 most-recent trades ($9.8M notional)
  • Ceasefire Apr7: 23,127 price candles (full history), 4,000 most-recent trades ($10.7M notional)

Price series sufficient for ILS computation. Trade-level wallet analysis limited to resolution window (last 1-2 days), not full pre-event history.

Approach history

5 approaches documented:

  1. Polygonscan getLogs — timed out at 13% (5h+ projected)
  2. Polygon RPC eth_getLogs — 82GB data transfer required
  3. The Graph subgraph — confirmed empty for both markets
  4. CLOB /trades — auth-walled
  5. CLOB /prices-history + data-api /trades — succeeded

Documents accessibility constraints of $1B+ markets on public Polymarket APIs.

Out of scope

  • 4 fficd-001 election markets remain blocked (Trump/Harris/Other Republican/Michelle Obama, $153M-$1.5B)
  • Full historical trade access requires Dune Analytics SQL (paid tier or free tier with rate limits)
  • Both deferred to future revisions

Side observations

  • Iran Apr30 price trajectory: opened 50%, peaked 64.5%, collapsed to 0.05%, resolved YES — interesting candidate for case study
  • Both markets currently classified as resolution_type='unclassifiable' but appear to be deadline-resolved by question formulation. Resolution typology classifier may need refinement.

Files

  • reports/TASK_02H_PHASE3_RESULTS.md
  • scripts/backfill_ffic_polygonscan_logs.py (CLOB prices + data-api trades collector)

After merge

Branch closes. Next: Task 03 (deadline-ILS implementation).

🤖 Generated with Claude Code

…indexer-failed markets

Both markets (Iran Apr30 $269M, Ceasefire Apr7 $174M) had zero trades in DB
due to The Graph indexer failure. Polygonscan getLogs and eth_getLogs are
infeasible (CTF Exchange emits 300 events/block across all markets; filtering
client-side requires 82GB transfer). The Graph subgraph confirmed empty for
both YES/NO token IDs.

Final approach: CLOB /prices-history (full 1-min candles, 14-day batches)
+ data-api.polymarket.com/trades (4,000 most-recent trades per market).

Results:
- Iran Apr30:    28,774 price candles (2026-03-18 – 2026-04-09) + 4,000 trades
- Ceasefire Apr7: 23,127 price candles (2026-03-24 – 2026-04-11) + 4,000 trades
- Both markets resolved YES; price data covers full market lifetime

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MaksymDS MaksymDS merged commit 63a5110 into master Apr 27, 2026
1 check failed
@MaksymDS MaksymDS deleted the task02h-phase3/polygonscan-logs branch May 1, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant