Query editor
/*Query outputs number of active wallets by a chosen time frame where the activity of the wallet is defined bywhether the wallet transacted the token in/out for the minimum amount of times (min_num_of_transactions)*/WITH-- 1. Counting number of transactions of the target token per wallet per day, both in and outtimebound_txns AS (SELECT wallet, time_interval, SUM(txn_cnt) AS total_txnsFROM (SELECT "from" AS wallet, DATE_TRUNC('{{time_interval}}', evt_block_time) AS time_interval, COUNT(*) AS txn_cntFROM erc20_{{blockchain}}.evt_transferWHERE contract_address = {{token_address}}GROUP BY "from", DATE_TRUNC('{{time_interval}}', evt_block_time)UNION ALLSELECT "to" AS wallet, DATE_TRUNC('{{time_interval}}', evt_block_time) AS time_interval, COUNT(*) AS txn_cntFROM erc20_{{blockchain}}.evt_transferWHERE contract_address = {{token_address}}GROUP BY "to", DATE_TRUNC('{{time_interval}}', evt_block_time)) AS txnsGROUP BY wallet, time_interval)-- Counting number of wallets which have made the min required number of transactions for the set time intervalSELECTCOUNT(wallet) AS active_wallets,time_intervalFROM timebound_txnsWHERE total_txns >= {{min_num_of_transactions}}GROUP BY time_intervalORDER BY time_interval DESC