adriaparcerisasTerra whales 22
    Updated 2022-01-27
    WITH
    supply as (
    select
    sum(balance) as total_supply
    from terra.daily_balances where date = CURRENT_DATE-1 and currency='LUNA' and balance_type ='liquid' and balance is not null
    ),
    top100 as (
    select
    address,
    sum(balance) as balance_LUNA
    from terra.daily_balances
    where address_label is null AND date = CURRENT_DATE-1 and currency='LUNA' and balance_type='liquid' and balance is not null
    group by 1
    order by 2 desc
    limit 100
    ),
    final_supply as (
    SELECT
    address,
    balance_LUNA,
    (balance_LUNA/total_supply)*100 as pcg_supply
    from top100 x, supply y
    )
    SELECT
    sum(balance_LUNA) as total_top100_balances,
    sum(pcg_supply) as total_pcg_circulating_supply
    from final_supply


    Run a query to Download Data