HosseinUntitled Query
Updated 2022-11-07
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
with list as (
select
date_trunc('day', timestamp) as day, avg(price_usd) as price, symbol
from near.core.fact_prices
group by day, symbol
)
select
token_out,
count(distinct(tx_hash)) as txn_count,
count(distinct (trader)) as trader_count,
sum(amount_out * price) as amount_usd
from list t1
join near.core.ez_dex_swaps t2
where 1 = 1
and t1.day = date_trunc('day', t2.block_timestamp)
and t1.day >= '{{ date }}'
and platform = 'v1.jumbo_exchange.near'
and token_out is not null
group by token_out
order by amount_usd desc
limit 10
Run a query to Download Data