mohammadhUntitled Query
Updated 2022-06-18
99
1
2
3
4
5
6
7
8
9
10
11
›
⌄
with A as(select count(TRADER) as USERS ,SPLIT_PART(TOKEN_OUT_CONTRACT , '.', 3) as token_name,sum(TOKEN_OUT_AMOUNT) as sum_amount,
date_trunc('day', block_timestamp) as block_day,
avg(PRICE_USD) as avg_price
from flow.core.fact_swaps inner join flow.core.fact_prices
group by block_day)
union all
select USERS,token_name,(sum_amount * avg_price) as sum_usd_volume from A
group by token_name,USERS
Run a query to Download Data