superflyUntitled Query
    Updated 2022-10-26
    with daily_prices as (select
    date(RECORDED_AT) as day,address,
    avg(PRICE) as price_usd from osmosis.core.dim_prices a join osmosis.core.dim_labels b on project_name = symbol group by
    day, address), daily_banalces as (
    select DATE as day,
    a.ADDRESS, BALANCE/pow(10, DECIMAL)*price_usd as liquidity_usd,
    case WHEN liquidity_usd < 10 THEN ' $0 to $10'
    WHEN liquidity_usd < 100 THEN ' $10 to $100'
    WHEN liquidity_usd < 1000 THEN ' $100 to $1,000'
    WHEN liquidity_usd < 10000 THEN ' $1,000 to $10,000'
    WHEN liquidity_usd < 100000 THEN ' $10,000 to $100,000'
    WHEN liquidity_usd < 1000000 THEN ' $100,000 to $1,000,000'
    ELSE '$1,000,000 and above'
    end as address_type from osmosis.core.fact_daily_balances a join daily_prices b on a.date=b.day and a.currency=b.address)
    select date_trunc('month', day) as mnth, address_type,
    count(*) as cnt from daily_banalces
    where day < '2022-10-01' group by mnth, address_type
    Run a query to Download Data