MahrooUntitled Query
Updated 2022-11-21Copy Reference Fork
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
›
⌄
with pricet as (
select timestamp::Date as day,
token,
symbol,
token_contract,
avg (price_usd) as USDPrice
from flow.core.fact_prices
where token != 'Blocto'
group by 1,2,3,4)
select date_trunc (week,block_timestamp) as date,
count (distinct tx_id) as TX_Count,
count (distinct sender) as Senders_Count,
count (distinct recipient) as Receivers_Count,
sum (amount) as Total_Token_Volume,
sum (amount*usdprice) as Total_USD_Volume,
avg (amount) as Average_Token_Volume,
avg (amount*usdprice) as Average_USD_Volume,
median (amount) as Median_Token_Volume,
median (amount*usdprice) as Median_USD_Volume,
min (amount) as Minimum_Token_Volume,
min (amount*usdprice) as Minimum_USD_Volume,
max (amount) as Maximum_Token_Volume,
max (amount*usdprice) as Maximum_USD_Volume,
sum (TX_Count) over (order by date) as Cumulative_TX_Count,
sum (Total_Token_Volume) over (order by date) as Cumulative_Token_Volume,
sum (Total_USD_Volume) over (order by date) as Cumulative_USD_Volume
from flow.core.ez_token_transfers t1 join pricet t2 on t1.token_contract = t2.token_contract and t1.block_timestamp::Date = t2.day
where symbol ilike 'Flow'
and tx_succeeded = 'TRUE'
group by 1
Run a query to Download Data