kiacryptoDaily average OSMO tx count, unique swapper and volume
Updated 2022-11-03Copy 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
33
34
35
36
›
⌄
with price as (
select
date_trunc('day', recorded_at) as day,
avg(price) as price
from osmosis.core.dim_prices
where symbol = 'OSMO'
group by 1
),
base as (
select
price * (from_amount/pow(10,from_decimal)) as volume, *
from osmosis.core.fact_swaps f join price on day = block_timestamp::date
where
block_timestamp::date >= '2022-03-07' and
tx_status = 'SUCCEEDED' and
from_currency = 'uosmo'
union all
select
price * (to_amount/pow(10,to_decimal)) as volume, *
from osmosis.core.fact_swaps f join price on day = block_timestamp::date
where
block_timestamp::date >= '2022-03-07' and
tx_status = 'SUCCEEDED' and
to_currency = 'uosmo'
),
daily_metrics as (
select
date_trunc('day', block_timestamp) as date,
case
when date between '2022-03-07' and '2022-05-07' then '60 days before Terra collapse'
when date between '2022-08-28' and '2022-10-27' then '60 days before listing on Binance'
when date = '2022-10-28' then 'listing on Binance'
when date > '2022-10-28' then 'after listing on Binance'
else 'others' end as dis,
Run a query to Download Data