Query editor
withonchain_filters as (--get all fids that hold a given tokenwithfids as (SELECTfid, custody_address as addressFROM dune.neynar.dataset_farcaster_fidsUNION ALLSELECTfid, from_hex(json_value(claim, 'strict $.address')) as addressFROM dune.neynar.dataset_farcaster_verifications)SELECTdistinct fidFROM dune.dune.result_wallet_all_chain_activity_summary sJOIN fids f ON s.wallet = f.addressWHERE '{{held token address}}' != 'none'AND contains(concat(erc20_addresses,nft_addresses),try(from_hex('{{held token address}}'))))SELECT*FROM query_3418402 qWHERE account_age <= {{user days old}}--filter for users who are holding a given tokenAND ('{{held token address}}' = 'none'OR q.fid IN (SELECT fid FROM onchain_filters))--filter for users of a given blockchain? probably not needed right now.--for a channel, do an approx_percentile on txs on only verified accounts and tier 1+order by {{user sort by}} descLIMIT 1000