Query editor
WITH vote_days AS (SELECT DISTINCTtopic1 AS voter,CAST(DATE_TRUNC('day', block_time - INTERVAL '15' HOUR) AS DATE) AS streak_dayFROM abstract.logsWHERE block_time >= TIMESTAMP '2026-02-25 15:00:00'AND contract_address = 0x3b50de27506f0a8c1f4122a1e6f470009a76ce2aAND topic0 = 0xea66f58e474bc09f580000e81f31b334d171db387d0c6098ba47bd897741679b),transition_anchors AS (SELECT voter, MAX(streak_day) AS anchor_dayFROM vote_daysWHERE streak_day BETWEEN DATE '2026-07-09' AND DATE '2026-07-10'GROUP BY 1),ranked AS (SELECTv.voter,v.streak_day,a.anchor_day,ROW_NUMBER() OVER (PARTITION BY v.voterORDER BY v.streak_day DESC) AS reverse_day_numberFROM vote_days vJOIN transition_anchors aON a.voter = v.voterAND v.streak_day <= a.anchor_day),transition_streaks AS (SELECTvoter,MAX(anchor_day) AS anchor_day,COUNT_IF(DATE_DIFF('day', streak_day, anchor_day) = reverse_day_number - 1) AS streak_at_transitionFROM rankedGROUP BY 1),last_votes AS (SELECT voter, MAX(streak_day) AS last_vote_dayFROM vote_daysGROUP BY 1)SELECTCONCAT('0x', TO_HEX(SUBSTR(t.voter, 13, 20))) AS account,t.streak_at_transition,t.anchor_day,l.last_vote_day,CAST(FLOOR((t.streak_at_transition - 1) / 10.0) * 10 AS BIGINT) AS frozen_streak_candidateFROM transition_streaks tJOIN last_votes l ON l.voter = t.voterWHERE t.streak_at_transition BETWEEN 20 AND 120AND l.last_vote_day <= DATE '2026-07-10'ORDER BY t.streak_at_transition DESCLIMIT 50