Query editor
-- PRESENTATION V2: Turbine LP history (target replacement for q7974318).---- Grain: one row per selected period, Ethereum verified production only.-- Full history is fixed internally; the only visible control is timeframe.-- "Current Deployment" means the hook with an open production configuration-- interval in the canonical attribution manifest. All other verified production-- hooks are "Previous Deployments".---- Correctness changes from q6706923:-- * LP owners come from the canonical LP fact, not the liquidity-router sender.-- * swap input is canonical slot-6 input and must match the paired hook event.-- * pool identity includes hook + pool_id, preventing token-pair/fee fan-out.-- * missing prices remain NULL; no unpriced USD value is converted to zero.-- * nominal pool-fee economics are labelled Estimated LP Fees, not revenue.WITH params AS (SELECT CASEWHEN '{{timeframe}}' IN ('daily', 'weekly', 'monthly')THEN '{{timeframe}}'ELSE 'weekly'END AS timeframe),period_spine AS (SELECT period_startFROM (SELECT sequence(TIMESTAMP '2025-05-20 00:00:00',date_trunc('day', CAST(CURRENT_TIMESTAMP AS TIMESTAMP)),INTERVAL '1' DAY) AS periodsFROM params WHERE timeframe = 'daily'UNION ALLSELECT sequence(date_trunc('week', TIMESTAMP '2025-05-20 00:00:00'),date_trunc('week', CAST(CURRENT_TIMESTAMP AS TIMESTAMP)),INTERVAL '7' DAY) AS periodsFROM params WHERE timeframe = 'weekly'UNION ALLSELECT sequence(date_trunc('month', TIMESTAMP '2025-05-20 00:00:00'),date_trunc('month', CAST(CURRENT_TIMESTAMP AS TIMESTAMP)),INTERVAL '1' MONTH) AS periodsFROM params WHERE timeframe = 'monthly') sCROSS JOIN UNNEST(s.periods) AS u(period_start)),periods AS (SELECTs.period_start,CASEWHEN p.timeframe = 'daily' THEN s.period_start + INTERVAL '1' DAYWHEN p.timeframe = 'weekly' THEN s.period_start + INTERVAL '7' DAY