SELECT
date,
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'
GROUP by date
ORDER by date desc
LIMIT 30