olavUntitled Query
Updated 2022-11-08
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
with price_list as (
select
date_trunc('day', timestamp) as date,
symbol,
avg(price_usd) as price
from near.core.fact_prices
group by 1, 2
)
select
date_trunc('month', b.date)::date "Month",
count(distinct(tx_hash)) "Transactions Count",
count(distinct (trader)) "Traders Count",
sum (price * amount_in) "Volume IN (USD)",
sum ("Transactions Count") over (order by "Month") "Comulative Transactions Count",
sum ("Traders Count") over (order by "Month") "Comulative Traders Count",
sum ("Volume IN (USD)") over (order by "Month") "Comulative Volume IN (USD)"
from near.core.ez_dex_swaps a
join price_list b
on a.block_timestamp::date = b.date
where symbol = token_in
group by 1
order by 1, 2 desc
Run a query to Download Data