HosseinUntitled Query
Updated 2023-01-21
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
›
⌄
with t as (
select
recorded_hour::date as day,
currency,
avg(price) as price_usd
from osmosis.core.ez_prices
group by 1, 2
),
t1 as (
select
day,
count(distinct tx_id) as swaps_count,
count(distinct trader) as swappers_count
from osmosis.core.fact_swaps a
join t on block_timestamp::date = day and t.currency = a.from_currency
where tx_succeeded = 1
and block_timestamp >= current_date - 90
group by day
)
select
avg(swaps_count) as average_swaps_count,
avg(swappers_count) as average_swappers_count
from t1
Run a query to Download Data