Query editor
WITH powerbadge_users AS (SELECT distinctpowerbadge_fid As fidFROMUNNEST (CAST(JSON_EXTRACT(json_parse(http_get ('https://api.warpcast.com/v2/power-badge-users')),'$.result.fids') as ARRAY (INTEGER))) t (powerbadge_fid)), channel_casters as (SELECTCOALESCE(root_parent_url, parent_url) as channel_url,fidFROM dune.neynar.dataset_farcaster_casts cWHERE deleted_at IS NULL-- todo: do we want to filter only for top level casts-- todo: filter out nft mint urls?AND (root_parent_url IS NOT NULL OR parent_url IS NOT NULL)GROUP BY 1, 2)SELECTcc.channel_url,COUNT(DISTINCT(cc.fid)) AS count,COUNT(DISTINCT(cc.fid)) * 100.0 / (SELECTCOUNT(*)FROM powerbadge_users) AS percentageFROM channel_casters ccJOIN powerbadge_users pON cc.fid = p.fidGROUP BY 1ORDER BY percentage DESC