Mojtaba-BanaeiOsmosis Wallet Balances & Ecosystem Growth - Top 100 Holders on Current Day - 3
    Updated 2023-04-13
    with Top_100_2022_01_01 as (
    select
    address
    , sum(balance/1e6) as total_balance
    , dense_rank() over(order by total_balance desc ) as rank
    from
    osmosis.core.fact_daily_balances
    where
    CURRENCY = 'uosmo'
    and date = '2022-01-01'::DATE
    group by address
    order by 2 desc
    limit 100
    )
    , current_whales as (
    select
    address
    , sum(balance/1e6) as total_balance
    , dense_rank() over(order by total_balance desc ) as rank
    from
    osmosis.core.fact_daily_balances
    where
    CURRENCY = 'uosmo'
    and date = CURRENT_DATE
    group by address
    order by 2 desc
    limit 100
    )

    select
    'Beginning of the Yaer' as "Wallet Type"
    , sum(total_balance) as "Total OSMO Volume"
    from
    Top_100_2022_01_01
    union
    select
    Run a query to Download Data