drone-mostafaCEX NET copy copy
Updated 2023-05-20
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
to_cex as (select
project_name,
avg (CLOSE) as Price,
count (distinct TX_ID) as TXN,
count (distinct SENDER) as Users,
sum ( DISTINCT AMOUNT) as volume,
volume * Price as USD
FROM flow.core.ez_token_transfers
JOIN flow.core.fact_hourly_prices ON ID = TOKEN_CONTRACT and RECORDED_HOUR::DATE = BLOCK_TIMESTAMP::DATE
JOIN crosschain.core.address_labels L ON ADDRESS = RECIPIENT
WHERE AMOUNT > 0 and LABEL_TYPE = 'cex' AND TX_SUCCEEDED = 'true'
group by 1),
from_cex as (select
project_name,
avg (CLOSE) as Price,
count (distinct TX_ID) as TXN,
count (distinct RECIPIENT) as Users,
sum ( DISTINCT AMOUNT) as volume,
volume * Price as USD
FROM flow.core.ez_token_transfers
JOIN flow.core.fact_hourly_prices ON ID = TOKEN_CONTRACT and RECORDED_HOUR::DATE = BLOCK_TIMESTAMP::DATE
JOIN crosschain.core.address_labels L ON ADDRESS = SENDER
WHERE AMOUNT > 0 and LABEL_TYPE = 'cex' AND TX_SUCCEEDED = 'true'
group by 1)
SELECT t1.project_name,
sum (t1.TXN) AS Inflow_TXN,
sum (t2.TXN) * -1 AS Outflow_TXN,
Run a query to Download Data