talebimorteza_722023-09-01 11:46 AM
99
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 treasury as (
select
day,
sum(amount) as treasury1
from
(
select
date_trunc('day', BLOCK_TIMESTAMP) as day,
sum(ETH_VALUE) as amount
from
base.core.fact_traces b
where
(
LOWER(TYPE) NOT IN ('delegatecall', 'callcode', 'staticcall')
or TYPE is null
)
AND TX_STATUS = 'SUCCESS'
AND TO_ADDRESS like lower('0xdd9176ea3e7559d6b68b537ef555d3e89403f742')
group by
1
union
all
select
date_trunc('day', BLOCK_TIMESTAMP) as day,
sum(ETH_VALUE * -1) as amount
from
base.core.fact_traces b
where
(
LOWER(TYPE) NOT IN ('delegatecall', 'callcode', 'staticcall')
or TYPE is null
)
AND TO_ADDRESS
AND FROM_ADDRESS = ='0xdd9176ea3e7559d6b68b537ef555d3e89403f742')
group by
1
Run a query to Download Data