davidwallUntitled Query
Updated 2023-01-18Copy 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
›
⌄
--credit : https://app.flipsidecrypto.com/velocity/queries/4296e26f-f034-4c1f-a477-b6236590bb9e
with osmopricet as (
select recorded_hour::date as date1,
avg (price) as OSMO_Price
from osmosis.core.ez_prices
where symbol = 'OSMO'
and recorded_hour >= '2022-12-01'
group by 1)
select date,
case when date = '2022-12-10' then 'December 10'
when date < '2022-12-10' then 'Previous Days'
when date > '2022-12-10' then 'Next Days'
end as timespan,
OSMO_Price,
sum (balance/pow(10,decimal)) as Total_OSMO_Balance,
avg (balance/pow(10,decimal)) as Average_OSMO_Balance
from osmosis.core.fact_daily_balances t1 join osmopricet t2 on t1.date = t2.date1
where date >= '2022-12-03' and date < '2022-12-18'
and currency = 'uosmo'
group by 1,2,3
order by 1
Run a query to Download Data