SELECT
sum(balance) as Total_balance_LUNA,
sum(balance_USD) as Total_balance_USD,
count(address) as Number_of_addresses,
avg(balance) as Average_address_balance_LUNA,
avg(balance_usd) as Average_address_balance_USD
FROM
terra.daily_balances
WHERE
currency = 'LUNA'
AND balance > 0
AND balance_type = 'liquid'
AND replace(left(date,10),'-','') = '20220128'
ORDER by balance desc
LIMIT 100