Query editor
WITH cast_data as (selectDATE_TRUNC('day', timestamp) AS trunc_date, fid, parent_hash, parent_url, casewhen regexp_like(upper(text), '[1-9]*[0-9]+ \$DEGEN') = TRUE then 1 else 0 end as degen_countfrom dune.neynar.dataset_farcaster_casts), tippingdays as (select * from query_3617856) -- number days someone has been doing at least one tip, activity as (SELECTc.fid, cast(COUNT(*) as real) AS total_casts, cast(sum(degen_count) as real) as total_tips, total_tipping_days, count(*) - sum(degen_count) as non_degen_post, COUNT(DISTINCT (c.trunc_date)) AS days_casting, COUNT(DISTINCT parent_hash) AS unique_parent_hashes, max(c.trunc_date) as recent_cast_date, casewhen max(c.trunc_date) > cast('2024-01-01 00:00' as timestamp) then 1else -1 end as active2024FROM cast_data cjoin tippingdays t on c.fid = t.fidGROUP BYc.fid, total_tipping_days), fid_cutoff as (select fidfrom query_3614922 -- fid registrationi date to create pre and post permissionless fidswhere created_at > cast('2023-10-11 00:00' as timestamp)order by created_at asc limit 1 )-- select * from activityselect a.*, round(cast((non_degen_post/total_casts)*100 as real),2) as non_degen_prop, casewhen a.fid < fc.fid then 'OG' else 'nonOG' end as OG, casewhen total_tipping_days > {{tipping_frequency}} then 1 else 0 end as tip_day_cutoff, casewhen total_casts > 0 then 1 else 0 end as activefrom activity a, fid_cutoff as fc