bachiosmo wallet2
Updated 2022-10-26
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
›
⌄
with balance_dtls as (
select date, balance_type, balance/pow(10, decimal) as balance_amt
from osmosis.core.fact_daily_balances
where date >= dateadd(month, -10, getdate())
and currency = 'uosmo'
and balance_type in ('liquid', 'staked')
),
liq_staked_dtls as (
select date, round(sum(balance_amt)) as bal_amt,
balance_type from balance_dtls
group by date, balance_type
),
osmo_dtls as (
select date(recorded_at) as day,
round(avg(price),2) AS osmo_price
from osmosis.core.dim_prices
where lower(symbol) = 'osmo'
and recorded_at >= dateadd(month, -10, getdate())
group BY day
order BY day desc
)
SELECT ls.date, ls.bal_amt, ls.balance_type,
op.osmo_price
FROM liq_staked_dtls ls
JOIN osmo_dtls op on
ls.date = op.day
ORDER BY ls.date desc
Run a query to Download Data