Query editor
-- ============================================================================-- Robinhood Chain — Discovery v2C — Genesis FIFO Extraction-- COMPLETE FILE — build candidate, not yet execution-stamped-- data_version = v2c-extraction-build-20260815-005-- score_version = 1.0.1-- cutoff = 2026-08-12 00:00 UTC-- ============================================================================---- PURPOSE-- Export the exact, chronologically ordered wallet inventory event stream-- required by the local deterministic FIFO engine. This query does NOT score-- wallets and does NOT emit QUALIFIED/REJECTED decisions.---- REQUIRED DUNE PARAMETER-- candidate_table---- Set candidate_table to the uploaded frozen CSV table, for example:-- dune.<your_handle>.dataset_robinhood_chain_qa1_v3_2_strict_5219_candidates---- The uploaded table must be created from:-- Robinhood_Chain_QA1_v3_2_STRICT_5219_candidates.csv-- Expected rows: 5,219-- Expected source data_version: qa1v3.2-r2parity-20260814-001-- Expected source SHA-256:-- fa10cbc765c29a8dd6a2ff3de89f7fe19aa05913231606225d822c99cd4cf09f---- BINDING IMPLEMENTATION RULES-- * Frozen four-class attribution from accepted v2B.-- * Full raw-chain coverage through the frozen cutoff.-- * One normalized economic BUY/SELL action per (trader, tx_hash).-- * D3: wallet receipt quantity, not gross pool quantity, is load-bearing.-- * D4: non-DEX wallet outbound removes FIFO lots at zero realized P&L.-- * Non-DEX inbound creates BASIS_UNKNOWN inventory.-- * Transfer and action events retain block/tx/log order.-- * Accountable actions are never silently dropped; failed receipt custody is-- emitted as ACTION_DIAGNOSTIC.-- * Follow-through remains a pool-price measure, separate from wallet basis.-- * All physical block-time columns are engine-confirmed timestamps with-- time zone; cutoff comparisons preserve those native types.-- * No activity-frequency exclusion and no inferred human/bot identity rule.---- OUTPUT ROW TYPES-- META one custody/coverage row-- CANDIDATE one membership row for every frozen candidate-- INVENTORY_EVENT rows consumed by the FIFO engine-- ACTION_DIAGNOSTIC normalized BUY/SELL without accountable receipt flow-- TRANSFER_DIAGNOSTIC wallet transfer with missing normalized quantity---- IMPORTANT-- Export the complete result as CSV immediately after the canonical run.-- The CSV hash, Dune execution ID, query version, row count and execution-- timestamp become source_snapshot_at metadata before results are interpreted.-- ============================================================================WITHparams AS (SELECTTIMESTAMP '2026-08-12 00:00:00 UTC' AS cutoff_time,DATE '2026-08-12' AS cutoff_date,