jackguy2023-03-22 11:20 AM
Updated 2023-03-22
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
⌄
SELECT
tx_hash,
sum(CASE when token LIKE 'WETH' then 1 when token LIKE 'WBTC' then 2 when token LIKE 'USDC' then 3 end)
FROM (
SELECT
block_timestamp,
tx_hash,
CASE when contract_address LIKE '0x4200000000000000000000000000000000000006' then 'WETH'
when contract_address LIKE '0x925afa2318825fcac673ef4ef551208b125dd965' then 'WBTC'
when contract_address LIKE '0x2e668Bb88287675e34c8dF82686dfd0b7F0c0383' then 'USDC' end as token
FROM base.goerli.fact_event_logs
--FROM base.goerli.fact_transactions
WHERE ORIGIN_FUNCTION_SIGNATURE LIKE '0x7dc20382'
--AND tx_hash LIKE '0x819945ffd1a79fdbefa04b8522af7fc2fe8c3de2b31c66ae45fb5a01f9c9dd93'
--GROUP BY 1,2,3
) GROUP BY 1
Run a query to Download Data