Query editor
WITH-- Source: Clanker “Deployed Contracts” (Base: 8453), v4.1.0 + v4.0.0-- https://clanker.gitbook.io/clanker-documentation/references/deployed-contractsclanker_addresses(address) AS (VALUES-- v4.1.0 (Base)(from_hex('d60d6b218116cfd801e28f78d011a203d2b068cc')), -- ClankerHookDynamicFeeV2(from_hex('b429d62f8f3bffb98cdb9569533ea23bf0ba28cc')), -- ClankerHookStaticFeeV2(from_hex('ebb25bb797d82cb78e1bc70406b13233c0854413')), -- ClankerSniperAuctionV2(from_hex('c5aa2945d52a4096b946891ef8e01668f82eb74e')), -- ClankerSniperUtilV2(from_hex('f652b3610d75d81871bf96db50825d9af28391e0')), -- ClankerAirdropV2(from_hex('aa12bb11e9876fcafc7c46dbeb985d3fa23832c9')), -- ClankerPoolExtensionAllowlist-- v4.0.0 (Base)(from_hex('e85a59c628f7d27878aceb4bf3b35733630083a9')), -- Clanker (factory)(from_hex('f3622742b1e446d92e45e22923ef11c2fcd55d68')), -- ClankerFeeLocker(from_hex('63d2dfea64b3433f4071a98665bcd7ca14d93496')), -- ClankerLpLockerFeeConversion(from_hex('8e845ead15737bf71904a30bddd3aee76d6adf6c')), -- ClankerVault(from_hex('56fa0da89ed94822e46734e736d34cab72df344f')), -- ClankerAirdrop(from_hex('1331f0788f9c08c8f38d52c7a1152250a9de00be')), -- ClankerUniv4EthDevBuy(from_hex('e143f9872a33c955f23cf442bb4b1efb3a7402a2')), -- ClankerMevBlockDelay(from_hex('fdc013ce003980889cffd66b0c8329545ae1d1e8')), -- ClankerSniperAuctionV0(from_hex('8806169969ae96bfaadb3efd4b10785beeb321b3')), -- ClankerSniperUtilV0(from_hex('34a45c6b61876d739400bd71228cbcbd4f53e8cc')), -- ClankerHookDynamicFee(from_hex('dd5eeaff7bd481ad55db083062b13a3cdf0a68cc')), -- ClankerHookStaticFee(from_hex('29d17c1a8d851d7d4ca97fae97acadb398d9cce0')) -- ClankerLpLocker),-- If you also want every token created by Clanker v4 on Base, union them here:clanker_tokens(address) AS (SELECT contract_address AS addressFROM clanker_v4_multichain.clanker_evt_tokencreatedwhere chain = 'base'),all_addresses AS (SELECT address FROM clanker_addressesUNION -- de-dupe; switch to UNION ALL if you want raw countsSELECT address FROM clanker_tokens),relevant_txns AS (SELECTDISTINCT tx_hashFROM base.tracesWHERE to in (select * from all_addresses)AND block_time >= date_add('week', -4, now()))SELECTdate_trunc('day',block_time) as ds,CASE WHEN r.tx_hash IS NOT NULL THEN 'touched contract'ELSE 'other'END AS source,SUM((l1_fee + gas_used * gas_price)/1e18) AS revenue_eth,SUM(p.price * (l1_fee + gas_used * gas_price)/1e18) AS revenue_usdFROM base.transactions tLEFT JOIN relevant_txns rON r.tx_hash = t.hash