saeide-ahmadi-7OSMO:ratio of liquid to staked
    Updated 2022-10-27
    with balances as (
    select
    date_trunc('week', date) as day,
    case
    when balance_type = 'liquid' then
    balance / pow (10,decimal)
    else 0
    end as liquid,
    case
    when balance_type = 'staked' then
    balance / pow (10,decimal)
    else 0
    end as staked
    from
    osmosis.core.fact_daily_balances
    where
    currency = 'uosmo' and date>'2022-01-01' and date<'2022-10-24'
    )
    select
    day,
    sum(liquid) as liquids,
    sum(staked) as stakeds,
    case
    when liquids!=0 and stakeds!=0 then
    liquids / stakeds
    else 0
    end as ratio
    from
    balances
    group by
    day
    order by
    day asc
    Run a query to Download Data