Query editor
witheas_fids as (SELECTr_fid, address, max(button_index) as button_index --pulling a max here since the example cast_hash did not have single attestation limits in place yet.FROM query_3393417 --https://dune.com/queries/3393417 query where I already pulled in EAS data and joined on farcaster fid dataWHERE cast_hash = {{cast_hash}}group by 1,2), farcaster_casts as (SELECTfid, count(*) as new_casts, count(distinct parent_url) as channels_castedFROM dune.neynar.dataset_farcaster_castsWHERE fid IN (SELECT distinct r_fid FROM eas_fids)group by 1), farcaster_give as (SELECTfid, sum(case when reaction_type = 1 then 1 else 0 end) as likes_given, sum(case when reaction_type = 2 then 1 else 0 end) as recasts_givenFROM dune.neynar.dataset_farcaster_reactionsWHERE fid IN (SELECT distinct r_fid FROM eas_fids)group by 1), farcaster_get as (SELECTtarget_fid as fid, sum(case when reaction_type = 1 then 1 else 0 end) as likes_gotten, sum(case when reaction_type = 2 then 1 else 0 end) as recasts_gottenFROM dune.neynar.dataset_farcaster_reactions rWHERE r.target_fid IN (SELECT distinct r_fid FROM eas_fids)group by 1), options as (SELECTcast(index as int) as index, optionFROM (selectsplit(replace(replace(regexp_extract(c.text,'\[(.*?)\]'),'[',''),']',''),',') as optionsFROM dune.neynar.dataset_farcaster_casts cWHERE c.hash = {{cast_hash}}) bLEFT JOIN unnest(options) WITH ORDINALITY o(option, index) on true)SELECTq.r_fid, get_href('https://warpcast.com/' || u.value, u.value) as name, COALESCE(o.option, cast(button_index as varchar)) as button_text, '||' as split_a, COALESCE(c.new_casts,0) as new_casts