MLDZMNptg10
Updated 2023-02-20Copy Reference Fork
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 t1 as (select
date_trunc('week', BLOCK_TIMESTAMP) as date,
sum(RAW_AMOUNT / 1e6) as total_deposit
from optimism.core.fact_token_transfers
where contract_address = lower('0x625E7708f30cA75bfd92586e17077590C60eb4cD')
and TO_ADDRESS= lower('0x4ecB5300D9ec6BCA09d66bfd8Dcb532e3192dDA1')
group by 1),
t2 as (select
date_trunc('week', BLOCK_TIMESTAMP) as date,
sum(RAW_AMOUNT / 1e6) as total_withdraw
from optimism.core.fact_token_transfers
where contract_address = lower('0x625E7708f30cA75bfd92586e17077590C60eb4cD')
and FROM_ADDRESS= lower('0x4ecB5300D9ec6BCA09d66bfd8Dcb532e3192dDA1')
group by 1),
t3 as (select
t1.date as date,
'Optimism' as chain,
total_deposit-total_withdraw as net_deposit,
sum(net_deposit) over (order by t1.date) as total_deposit
from t1
left join t2 on t1.date=t2.date),
t4 as (select
date_trunc('week', BLOCK_TIMESTAMP) as date,
sum(RAW_AMOUNT / 1e6) as total_deposit
from Polygon.core.fact_token_transfers
where contract_address = lower('0xD4F6d570133401079D213EcF4A14FA0B4bfB5b9C')
and TO_ADDRESS= lower('0x19de635fb3678d8b8154e37d8c9cdf182fe84e60')
group by 1),
t5 as (select
date_trunc('week', BLOCK_TIMESTAMP) as date,
sum(RAW_AMOUNT / 1e6) as total_withdraw
from Polygon.core.fact_token_transfers
Run a query to Download Data