anderhelPython window
Updated 2023-03-27Copy Reference Fork
9
1
›
select DATE_TRUNC('month', block_timestamp) as maned, count(distinct ADDRESS) FROM (SELECT tx_hash, STATUS, block_timestamp, FROM_ADDRESS AS ADDRESS from ethereum.core.fact_transactions UNION SELECT tx_hash, STATUS, block_timestamp, TO_ADDRESS AS ADDRESS from ethereum.core.fact_transactions ) as SubQuery where tx_hash in ( select tx_hash from( SELECT distinct tx_hash FROM ethereum.core.ez_eth_transfers as transfers2 left join ethereum.core.dim_labels as labels3 on transfers2.eth_to_address = labels3.address WHERE LABELS3.LABEL_TYPE = 'cex' and year(block_timestamp) in (2021, 2022, 2023) UNION SELECT distinct tx_hash FROM ethereum.core.ez_eth_transfers as transfers3 left join ethereum.core.dim_labels as labels4 on transfers3.eth_from_address = labels4.address WHERE LABELS4.LABEL_TYPE = 'cex' and year(block_timestamp) in (2021, 2022, 2023) UNION SELECT distinct tx_hash FROM ethereum.core.ez_token_transfers as transfers2 left join ethereum.core.dim_labels as labels3 on transfers2.to_address = labels3.address WHERE LABELS3.LABEL_TYPE = 'cex' and year(block_timestamp) in (2021, 2022, 2023) UNION SELECT distinct tx_hash FROM ethereum.core.ez_token_transfers as transfers3 left join ethereum.core.dim_labels as labels4 on transfers3.from_address = labels4.address WHERE LABELS4.LABEL_TYPE = 'cex' and year(block_timestamp) in (2021, 2022, 2023) ) tx_hashes) and tx_hash not in ( select tx_hash from( SELECT distinct tx_hash FROM ethereum.core.EZ_NFT_MINTS where year(block_timestamp) in (2021, 2022, 2023) UNION SELECT distinct tx_hash FROM ethereum.core.EZ_NFT_SALES where year(block_timestamp) in (2021, 2022, 2023) UNION SELECT distinct tx_hash FROM ethereum.core.EZ_NFT_TRANSFERS where year(block_timestamp) in (2021, 2022, 2023) union SELECT distinct tx_hash FROM ethereum.AAVE.EZ_FLASHLOANS where year(block_timestamp) in (2021, 2022, 2023) UNION SELECT distinct tx_hash FROM ethereum.MAKER.EZ_FLASH_LOANS where year(block_timestamp) in (2021, 2022, 2023) union SELECT distinct tx_hash FROM ethereum.core.EZ_DEX_SWAPS where year(block_timestamp) in (2021, 2022, 2023) UNION SELECT distinct tx_hash FROM ethereum.core.fact_transactions where ORIGIN_F![]()
![]()
Run a query to Download Data