Query editor
WITH daily_transfers AS (SELECTDATE_TRUNC('day', evt_block_time) AS time,"to" as walletFROM erc20_base.evt_transferWHERE contract_address = 0x79dacb99A8698052a9898E81Fdf883c29efb93cb and value/1e18 >= 1UNION ALLSELECTDATE_TRUNC('day', evt_block_time) AS time,"from" as walletFROM erc20_base.evt_transferWHERE contract_address = 0x79dacb99A8698052a9898E81Fdf883c29efb93cb and value/1e18 >= 1),new_wallets AS (select first_transaction as time, count(wallet) as new_users from (SELECTwallet,MIN(time) AS first_transactionFROM daily_transfersGROUP BY 1)GROUP BY 1),stats AS (SELECTdate_trunc('day', evt_block_time) as time,COUNT(DISTINCT "to") AS unique_walletsFROM erc20_base.evt_transfer tWHERE contract_address = 0x79dacb99A8698052a9898E81Fdf883c29efb93cb and value/1e18 >= 1GROUP BY 1)SELECTs.time,COALESCE(new_users,0) AS new_users,unique_wallets-COALESCE(new_users,0) AS returning_usersFROM stats sLEFT JOIN new_wallets nw on s.time=nw.timeORDER BY time DESC