azerbaijanUntitled Query
    Updated 2022-10-25
    with prices as (
    select recorded_at::date as day,
    symbol,
    address,
    avg (price) as USDPrice
    from osmosis.core.dim_prices p join osmosis.core.dim_labels l on project_name = symbol
    group by 1,2,3),

    wallets as (
    select
    'Humpback Whale' as types,
    p.address,
    sum (balance*usdprice/pow(10,decimal)) as USD_Balance
    from osmosis.core.fact_daily_balances p join prices l on p.currency = l.address and p.date = l.day
    where date = (select max (date) from osmosis.core.fact_daily_balances)
    group by 1,2
    having usd_balance >= 10000000

    union ALL

    select
    'Whale' as types,
    p.address,
    sum (balance*usdprice/pow(10,decimal)) as USD_Balance
    from osmosis.core.fact_daily_balances p join prices l on p.currency = l.address and p.date = l.day
    where date = (select max (date) from osmosis.core.fact_daily_balances)
    group by 1,2
    having usd_balance >= 1000000 and usd_balance < 10000000

    union ALL

    select
    'Shark' as types,
    p.address,
    sum (balance*usdprice/pow(10,decimal)) as USD_Balance
    from osmosis.core.fact_daily_balances p join prices l on p.currency = l.address and p.date = l.day
    Run a query to Download Data