Task 02h Phase 3: CLOB-based recovery for indexer-failed FFIC fficd-003 markets#9
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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:
Documents accessibility constraints of $1B+ markets on public Polymarket APIs.
Out of scope
Side observations
resolution_type='unclassifiable'but appear to be deadline-resolved by question formulation. Resolution typology classifier may need refinement.Files
reports/TASK_02H_PHASE3_RESULTS.mdscripts/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