emirprince95All LUNA balances in the last day
    Updated 2022-01-25
    select date_trunc('day', date) as date, address, currency, sum(balance) as balance_amount
    from terra.daily_balances
    where currency = 'LUNA' and date = CURRENT_DATE() - 1 --take only the latest complete data of LUNA
    and trim(address_label) is null and trim(address_label_subtype) is null and trim(address_label_type) is null -- condition for normal account
    and address != 'terra1gr0xesnseevzt3h4nxr64sh5gk4dwrwgszx3nw' -- This is not a normal wallet, it LUNA's Foundation Guard wallet, I had to manually filter this out since it wasn't detected by the previous conditions
    and balance > 0.01
    group by date, currency, address --aggregate each address's LUNA balance
    order by balance_amount desc

    Run a query to Download Data