Query editor
WITH follow_data AS (SELECT follower,profile_idFROM(SELECTfollower,ARRAY[CAST(profile_ids AS uint256)] AS profile_idsFROM(SELECTJSON_VALUE(vars,'lax $.follower') as follower,json_query(vars, 'lax $.profileIds[*]') AS profile_idsFROMlens_polygon.LensHub_call_followWithSig-- limit 100)UNION ALLSELECTCAST(t."from" AS VARCHAR) AS follower, f.profileIds AS profile_idsFROMlens_polygon.LensHub_call_follow AS fINNER JOIN polygon.transactions AS t ON f.call_tx_hash = t.hashWHEREcall_block_time >= CAST('2022-05-18' /* Lens launch date */ AS TIMESTAMP)AND block_time >= CAST('2022-05-18' AS TIMESTAMP)-- limit 100) AS fCROSS JOIN UNNEST (f.profile_ids) AS b (profile_id)),following_summary AS (SELECTCOUNT(*) AS total_following_count,COUNT(DISTINCT follower) AS follower_address_count,COUNT(DISTINCT profile_id) AS followed_profile_countFROMfollow_data),top_followed_profiles AS (SELECTprofile_id,COUNT(follower) AS follower_countFROMfollow_dataGROUP BY1ORDER BY2 DESCLIMIT1000)SELECTprofile_id,follower_count,SUM(follower_count) OVER () AS top_profile_follower_count,total_following_count,follower_address_count,followed_profile_count,