amelia-leeunuse
Updated 2022-11-22
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
select
date_trunc('week', S.BLOCK_TIMESTAMP) as date,
PROJECT_NAME,
avg (PRICE_USD) as Price,
count (distinct TX_ID) as TXN,
count (distinct SENDER) as Users,
sum ( DISTINCT AMOUNT) as volume,
volume * Price as USD,
sum (TXN) over (partition by PROJECT_NAME order by date ) as cum_TXN,
sum (Users) over (partition by PROJECT_NAME order by date ) as cum_Users,
sum (USD) over (partition by PROJECT_NAME order by date ) as cum_USD
FROM flow.core.ez_token_transfers S
JOIN flow.core.fact_prices P ON P.TOKEN_CONTRACT = S.TOKEN_CONTRACT and P.TIMESTAMP::DATE = S.BLOCK_TIMESTAMP::DATE
JOIN crosschain.core.address_labels L ON L.ADDRESS = S.RECIPIENT
WHERE AMOUNT > 0 and LABEL_TYPE = 'cex' and TX_SUCCEEDED = 'TRUE'
and S.BLOCK_TIMESTAMP < CURRENT_DATE
group by 1,2
Run a query to Download Data