Query editor
-- [CA] R1c — Stablecoin depeg series on the FULL window (2024-01-01…now)-- Keyed on contract_address ONLY (Lesson #1: never group prices by symbol).-- Canonical whitelist derived FROM DATA by Q8 (query 8729213, 2026-09-15):-- for each stablecoin symbol, the Ethereum contract whose hourly price sits-- inside the [0.99,1.01] band most of the time. Q8 found 17 canonical-- contracts and 151 impostor contracts carrying a stablecoin symbol-- (registry previously said 28 — that figure was USDC/USDT/DAI in a 90d-- window only). Impostors are EXCLUDED here by construction.---- Stage 1 (this query): prices.hour -> daily min/max/avg per canonical contract.-- Output drives H7 (deviation 0.3-1.0% -> reversion within 24h) and-- H8 (deviation >2% -> no reversion within 7d). Deviation is reported in-- basis points of $1 so the Strategist can apply thresholds locally.-- Stage 2 (separate query, only for days flagged here): prices.minute on the-- flagged (contract, day) pairs to time the reversion precisely.---- Coverage notes:-- * LUSD n=764 in Q8 (thin) and AUSD/USDS have out-of-band extremes —-- treat those three as low-confidence, do not silently drop them.-- * rows are split train (<2026-01-01) / holdout for §6 discipline.SELECT date_trunc('day', "timestamp") AS day,symbol,contract_address,MIN(price) AS min_price,MAX(price) AS max_price,AVG(price) AS avg_price,COUNT(*) AS samples,ROUND(10000 * (MIN(price) - 1), 2) AS min_bps,ROUND(10000 * (MAX(price) - 1), 2) AS max_bps,ROUND(10000 * (AVG(price) - 1), 2) AS avg_bps,GREATEST(ABS(10000 * (MIN(price) - 1)),ABS(10000 * (MAX(price) - 1))) AS max_abs_bps,CASE WHEN date_trunc('day', "timestamp") < DATE '2026-01-01'THEN 'train' ELSE 'holdout' END AS splitFROM prices.hourWHERE blockchain = 'ethereum'AND "timestamp" >= TIMESTAMP '2024-01-01 00:00:00'AND symbol IN ('USDT', 'USDC', 'DAI', 'USDe', 'PYUSD', 'TUSD', 'USDD','USD1', 'GHO', 'crvUSD', 'FRAX', 'LUSD', 'USDS', 'USDP','USDtb', 'RLUSD', 'AUSD')AND contract_address IN (from_hex('6b175474e89094c44da98b954eedeac495271d0f'), -- DAIfrom_hex('a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'), -- USDCfrom_hex('dac17f958d2ee523a2206206994597c13d831ec7'), -- USDTfrom_hex('4c9edd5852cd905f086c759e8383e09bff1e68b3'), -- USDefrom_hex('6c3ea9036406852006290770bedfcaba0e23a0e8'), -- PYUSDfrom_hex('0000000000085d4780b73119b644ae5ecd22b376'), -- TUSDfrom_hex('4f8e5de400de08b164e7421b3ee387f461becd1a'), -- USDDfrom_hex('8d0d000ee44948fc98c9b98a4fa4921476f08b0d'), -- USD1from_hex('40d16fc0246ad3160ccc09b8d0d3a2cd28ae6c2f'), -- GHOfrom_hex('f939e0a03fb07f59a73314e73794be0e57ac1b4e'), -- crvUSDfrom_hex('853d955acef822db058eb8505911ed77f175b99e'), -- FRAXfrom_hex('dc53cc918c925beb02ef5eca4d83449913bb7f5a'), -- LUSD (thin)from_hex('dc035d45d973e3ec169d2276ddab16f1e407384f'), -- USDSfrom_hex('8e870d67f660d95d5be530380d0ec0bd388289e1'), -- USDPfrom_hex('c139190f447e929f090edeb554d95abb8b18ac1c'), -- USDtbfrom_hex('8292bb45bf1ee4d140127049757c2e0ff06317ed'), -- RLUSDfrom_hex('00000000efe302beaa2b3e6e1b18d08d69a9012a') -- AUSD)GROUP BY 1, 2, 3