prbhvgupta2023-12-12 03:33 PM
999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with traces_initial as (
select
date(block_timestamp) as date,
tx_hash as transaction_hash ,
from_address as "from",
to_address as "to",
eth_value as value,
'call' as trace_type,
(case when trace_status = 'SUCCESS' then true else false end) as success,
type as call_type
from OPTIMISM.CORE.FACT_TRACES tr
where 1=1
-- and date(block_timestamp) in ('2023-10-01','2023-10-02')
--and trace_type = 'call'
and date >= '2023-11-23'
and trace_status = 'SUCCESS'
and (type not in ('DELEGATECALL', 'STATICCALL', 'CALLCODE'))
order by trace_index asc
),
transfer_in as (
select
date,
transaction_hash,
"to" as address,
sum(value) as eth_in
from traces_initial
-- AND cast(value as double) > 0
group by 1,2,3
),
transfer_out as (
select
date,
transaction_hash,
"from" as address,
Run a query to Download Data