Query editor
WITH first_replies AS (SELECTDATE(timestamp) AS reply_date,fid AS replier_fid,hash AS reply_hash,root_parent_hash,parent_fid as og_fid,timestamp AS reply_timestampFROMdune.neynar.dataset_farcaster_castsWHEREparent_hash = root_parent_hashAND hash != root_parent_hashand "text" not like '%$%'and parent_fid != fidand fid < 100000),replies_to_first_replies AS (SELECTfr.reply_date,fr.reply_hash,fr.replier_fid,t.fid AS responder_fid,t.timestamp AS response_timestampFROMfirst_replies frJOINdune.neynar.dataset_farcaster_casts t ON fr.reply_hash = t.parent_hashWHEREt.fid != fr.og_fid andt.fid != fr.replier_fidAND t.fid != (SELECT fid FROM dune.neynar.dataset_farcaster_casts WHERE hash = fr.root_parent_hash)and "text" not like '%$%'),mutual_responses AS (SELECTrtr.reply_date,rtr.reply_hashFROMreplies_to_first_replies rtrJOINdune.neynar.dataset_farcaster_links l1 ON l1.fid = rtr.replier_fid AND l1.target_fid = rtr.responder_fidJOINdune.neynar.dataset_farcaster_links l2 ON l2.fid = rtr.responder_fid AND l2.target_fid = rtr.replier_fidWHEREl1.timestamp < rtr.response_timestampAND l2.timestamp < rtr.response_timestampAND (l1.deleted_at IS NULL OR l1.deleted_at > rtr.response_timestamp)AND (l2.deleted_at IS NULL OR l2.deleted_at > rtr.response_timestamp))SELECTfr.reply_date,COUNT(fr.reply_hash) AS total_first_replies,COUNT(DISTINCT rtr.reply_hash) AS first_replies_with_any_response,COUNT(DISTINCT mutual_resp.reply_hash) AS first_replies_with_mutual_response,ROUND(COUNT(DISTINCT mutual_resp.reply_hash) * 100.0 / NULLIF(COUNT(fr.reply_hash), 0), 2) AS percentage_mutual_responsesFROMfirst_replies frLEFT JOINreplies_to_first_replies rtr ON fr.reply_hash = rtr.reply_hash