dr18882023-03-13 04:30 PM
Updated 2023-03-13
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 A as
(
select
BLOCK_TIMESTAMP::Date as BTD,
FROM_ADDRESS as FA,
sum(RAW_AMOUNT) as SRMF
from avalanche.core.fact_token_transfers
where CONTRACT_ADDRESS = lower('0x152b9d0FdC40C096757F570A51E494bd4b943E50')
group by 1,2
),
B as
(
select
TO_ADDRESS as TA,
sum(RAW_AMOUNT) as SRMT
from avalanche.core.fact_token_transfers
where CONTRACT_ADDRESS = lower('0x152b9d0FdC40C096757F570A51E494bd4b943E50')
group by 1
),
C as
(
select
BTD, FA, SRMF,SRMT
from
A
Left JOIN
B
on
A.FA=B.TA
--group by 1
--group by A.FA
)
select
BTD,
sum(case when SRMT-SRMF >0 then 1 else 0 end) as CHT,
sum(CHT) over (order by BTD) as SCHT
Run a query to Download Data