SELECT
count(address) as Total_addresses,
sum(balance_usd) as Total_balance_USD,
sum(balance) as Total_balance_LUNA
FROM (
SELECT
address,
balance_usd,
balance
FROM
terra.daily_balances
WHERE
currency = 'LUNA'
AND balance_type = 'liquid'
AND balance > 0
AND replace(left(date,10),'-','') = '20220127'
ORDER by 2 desc
LIMIT 2
)