Query editor
with agg as(with transfers as((SELECT"to" as wallet,'mint' as action,1 as valueFROM nft.transferswhere contract_address = 0x46Ac8540d698167FCBb9e846511Beb8CF8af9BD8and "from" = 0x0000000000000000000000000000000000000000)union all(SELECT"to" as wallet,'gain' as action,1 as valueFROM nft.transferswhere "contract_address" = 0x46Ac8540d698167FCBb9e846511Beb8CF8af9BD8and "from" != 0x0000000000000000000000000000000000000000)union all(SELECT"from" as wallet,'lose' as action,-1 as valueFROM nft.transferswhere contract_address = 0x46Ac8540d698167FCBb9e846511Beb8CF8af9BD8and "from" != 0x0000000000000000000000000000000000000000))selectwallet,sum(value) as tokensfromtransfersgroup by walletorder by tokens desc)selectcount(distinct wallet) as owners,max(tokens) as most_owned,avg(tokens) as average_owned,count(distinct wallet) filter (where tokens = 1) as single_token_walletsfromaggwhere tokens > 0