keshanTop 1%
    Updated 2022-01-24
    with a as (SELECT sum(balance) as holding, address, address_name
    FROM terra.daily_balances
    where BALANCE_TYPE = 'liquid'
    and CURRENCY = 'LUNA'
    and address_label_subtype != 'mints_burns'
    and address_label_subtype != 'mint_burn'
    --and address_label_type != 'dex'
    and address_label_subtype != 'staking'
    and address_label_subtype != 'staking_contract'
    and address_label_subtype != 'token_vesting'
    --and address_name != 'community pool'
    and date_trunc('day', date) = date_trunc('day', CURRENT_DATE())-1
    group by address, address_name
    order by holding desc),
    b as (select sum(holding) as val from a)
    select address, address_name, holding, (holding/(select sum(holding) as val from a))*100 as perc from a

    group by 1, 2, 3
    order by holding desc
    Run a query to Download Data