Query editor
WITH monthly_stats AS (SELECT DATE_TRUNC('month', block_time) AS month,CASEWHEN ("from" not in (select distinct address from ethereum.creation_traces)and "to" not in (select distinct address from ethereum.creation_traces)AND CAST(value AS DOUBLE) > 0AND hash not in (select tx_hash from ethereum.creation_traces))THEN 'Simple ETH Transfer'when "to" in (0x8d12a197cb00d4747a1fe03395095ce2a5cc6819,0x4aea7cf559f67cedcad07e12ae6bc00f07e8cf65) THEN 'Ether Delta'when "to" = 0x06012c8cf97bead5deae237070f9587f8e7a266d then 'CryptoKitties'when "to" = 0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208 then 'IDEX'when "to" in (0xdd9fd6b6f8f7ea932997992bbe67eabb3e316f3c,0xae9b8e05c22bae74d1e8db82c4af122b18050bd4) then '1st Gen Gaming' -- Last Winner, Biigowhen "to" = 0x182ebf4c80b28efc45ad992ecbb9f730e31e8c7f then 'Livepeer Mining'when "to" in (0x01eacc3ae59ee7fbbc191d63e8e1ccfdac11628c,0x5acc84a3e955bdd76467d3348077d003f00ffb97,0x174BfA6600Bf90C885c7c01C7031389ed1461Ab9) then 'Scams'when ("to" in (select distinct address from labels.mev_ethereum)and hash not in (select distinct tx_hash from dex.trades where blockchain = 'ethereum'))then 'MEV'--Fairwin.me, Forsage, MGC Tokenwhen hash in (select distinct tx_hash from dex.trades where blockchain = 'ethereum')then 'DEX Trade'when hash in (select distinct tx_hash from nft.trades where blockchain = 'ethereum')then 'NFT Trade'when hash in (select distinct tx_hash from nft.mints where blockchain = 'ethereum')then 'NFT Mints'when ("to" in (select address from labels.stablecoins where blockchain = 'ethereum')and hash not in (select distinct tx_hash from dex.trades where blockchain = 'ethereum'))then 'Simple Stablecoin Transfer'when ("to" not in (select address from labels.stablecoins where blockchain = 'ethereum')and "to" in (select contract_address from tokens.erc20 where blockchain = 'ethereum')and hash not in (select distinct tx_hash from dex.trades where blockchain = 'ethereum')and hash not in (select distinct tx_hash from nft.trades where blockchain = 'ethereum')and hash not in (select distinct tx_hash from nft.mints where blockchain = 'ethereum'))then 'Simple ERC20 Transfer'when hash in (select tx_hash from ethereum.creation_traces)then 'Contract Creation'ELSE 'Others'END AS transfer_type,SUM(gas_used) AS total_gas_usedFROM ethereum."transactions"GROUP BY1,2)select month, case when total_gas_used<100000000 then 'Others'else transfer_type end as transfer_type,sum(total_gas_used) as total_gas_usedfrom monthly_statsgroup by 1,2