Query editor
-- Fee history/tail/live boundary, key and revenue-split gate for the rolling-- history (60). Ten rows, all 'pass'; TYHOT requires exactly ten.WITHh AS (SELECT *FROM dune.propeller_heads.result_tycho_fee_recipient_fact_v3_history_20260924),b AS (SELECT CAST(date_add('day', 1, MAX(block_date)) AS TIMESTAMP) AS boundaryFROM h),t AS (SELECT *FROM dune.propeller_heads.result_tycho_fee_recipient_fact_v3_tail),-- The tail rescans the last 8 days; the live keeps only its rows at or-- after the history boundary.t_live AS (SELECT t.*FROM tCROSS JOIN bWHERE t.block_time >= b.boundary),l AS (SELECT *FROM dune.propeller_heads.result_tycho_fee_recipient_fact_v3_live),checks AS (-- An empty history has no boundary; every live row would be lost.SELECT 'history_boundary_missing' AS check_name,CASE WHEN (SELECT boundary FROM b) IS NULL THEN 1 ELSE 0 ENDAS failing_rowsUNION ALL-- The tails start at current UTC date - 8 days. A history boundary-- before that (more than four missed daily rolls) leaves a gap.SELECT 'tail_coverage_gap',CASE WHEN (SELECT boundary FROM b) IS NULLOR (SELECT boundary FROM b)< CAST(date_add('day', -8, CURRENT_DATE) AS TIMESTAMP)THEN 1 ELSE 0 ENDUNION ALLSELECT 'history_duplicate_key', COUNT(*)FROM (SELECT fee_recipient_key FROM h GROUP BY 1 HAVING COUNT(*) > 1)UNION ALLSELECT 'tail_duplicate_key', COUNT(*)FROM (SELECT fee_recipient_key FROM t GROUP BY 1 HAVING COUNT(*) > 1)UNION ALLSELECT 'cross_partition_duplicate_key', COUNT(*)FROM h INNER JOIN t_live USING (fee_recipient_key)UNION ALLSELECT 'live_duplicate_key', COUNT(*)FROM (SELECT fee_recipient_key FROM l GROUP BY 1 HAVING COUNT(*) > 1)UNION ALL