Query editor
WITH followers AS (-- Get all followers of fid = {{fid}}SELECT DISTINCT fidFROM dune.neynar.dataset_farcaster_linksWHERE target_fid = {{fid}} -- Use the parameter for fidAND type = 'follow'AND deleted_at IS NULL),followers_with_names AS (-- Join followers with their fname from the profile tableSELECT f.fid, p.fnameFROM followers fLEFT JOIN dune.neynar.dataset_farcaster_profile_with_addresses pON f.fid = p.fid -- Get fname directly from profile table)SELECTfwn.fid,get_href('https://warpcast.com/' || fwn.fname, fwn.fname) AS fname, -- Hyperlink the fnameCOALESCE(COUNT(c.fid), 0) AS total_casts -- Count of casts in the last 6 months, 0 if no castsFROM followers_with_names fwnLEFT JOIN dune.neynar.dataset_farcaster_casts cON fwn.fid = c.fidAND c.deleted_at IS NULLAND c.timestamp >= CURRENT_TIMESTAMP - INTERVAL '6' MONTHGROUP BY fwn.fid, fwn.fnameORDER BY total_casts DESC;