Query editor
with holder_balance as (with address_date_list as (with min_max_date as (select min(date(evt_block_time)) as min_date,max(date(evt_block_time)) as max_datefrom erc721_ethereum.evt_Transferwhere contract_address = 0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03),date_series as (select block_date-- from unnest(sequence(date((select min_date from min_max_date)), date((select max_date from min_max_date)), interval '1' day)) as s(block_date)from unnest(sequence(date('2018-01-01'), date(now()), interval '1' day)) as s(block_date)-- select unnest(sequence(min_date, max_date, interval '1' day)) as block_date-- from min_max_date-- with dates AS-- (-- with day_seq as (-- SELECT sequence(-- (SELECT min_date FROM min_max_date)-- , (SELECT max_date FROM min_max_date)-- , interval '1' day) as "date"-- )-- SELECT-- dates.date-- FROM day_seq-- CROSS JOIN unnest(date) as weeks(date) --this is just doing explode like in spark sql-- )-- select * FROM dates),holder_address_list as (select distinct address from(select "from" as address from erc721_ethereum.evt_Transferwhere contract_address = 0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03unionselect "to" as address from erc721_ethereum.evt_Transferwhere contract_address = 0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03) t)select block_date, addressfrom date_seriesfull outer join holder_address_list on true),daily_transfer_summary as (with transfers_details as (select date_trunc('day', evt_block_time) as block_date, "to" as address, count(evt_tx_hash) as transaction_countfrom erc721_ethereum.evt_Transferwhere contract_address = 0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03group by 1, 2union allselect date_trunc('day', evt_block_time) as block_date, "from" as address, count(evt_tx_hash)*(-1) as transaction_countfrom erc721_ethereum.evt_Transfer