Query editor
with towns_created as (selectblock_time,tx_hash,substring(topic1 from 13 for 20) as owner,bytearray_to_int256(substring(topic2 from 1 for 32 )) as tokenid,substring(topic3 from 13 for 20) as townfrom base.logswhere contract_address = 0x9978c826d93883701522d2CA645d5436e5654252and topic0 = 0xe50fc3942f8a2d7e5a7c8fb9488499eba5255b41e18bc3f1b4791402976d1d0band block_time > cast('2024-05-01' as timestamp)),member_added as (selectcontract_address as town,substring(topic1 from 13 for 20) as recipient,substring(topic2 from 1 for 32) as tokenidfrom base.logswhere topic0 = 0x2f40b0474996b72a4251e00fb9170cdd960deea1dc749772cbbab61395b9b576and block_time > cast('2024-05-01' as timestamp)),summary as (selectdate_trunc('day',block_time) as day,count(*) as towns_created,count(distinct owner) as unique_creatorsfrom towns_created cgroup by 1),days AS(select cast(day as timestamp) as dayfrom unnest(sequence(date('2024-5-30'), cast(now() as date), interval '1' day)) as t(day) -- "2024-06-13")selectd.day,s.towns_created as daily_towns_created,s.unique_creators,sum(coalesce(towns_created,0)) over (order by d.day) as total_towns_createdfrom days dleft join summary s on d.day = s.dayorder by 1 desc