ArashhUntitled Query
Updated 2023-03-02Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
with t1 as
(select
distinct TX_HASH as TX_HASH
from ethereum.core.fact_event_logs
WHERE
CONTRACT_ADDRESS=lower('0x304acf330bbE08d1e512eefaa92F6a57871fD895') or CONTRACT_ADDRESS=lower('0x2d5d7d31F671F86C782533cc367F14109a082712') ),
t2 as
(select distinct TX_HASH from ethereum.core.fact_token_transfers
where
ORIGIN_TO_ADDRESS in ('0x304acf330bbE08d1e512eefaa92F6a57871fD895','0x2d5d7d31F671F86C782533cc367F14109a082712')
or
ORIGIN_FROM_ADDRESS in ('0x304acf330bbE08d1e512eefaa92F6a57871fD895','0x2d5d7d31F671F86C782533cc367F14109a082712')
)
select count(distinct TX_HASH) as number ,date_trunc('day',BLOCK_TIMESTAMP) as date ,
case when TX_HASH in (select TX_HASH from t2) then 'callContractWithToken' else 'callContract' end as type,
count(distinct ORIGIN_FROM_ADDRESS) as originTO,
count(distinct ORIGIN_TO_ADDRESS) as originFROM
from ethereum.core.fact_event_logs
where TX_HASH in (select TX_HASH from t1)
group by date,type
Run a query to Download Data