select trader
,sum(TO_AMOUNT/1e6) as "Buy Volume of $Luna"
,rank()over(order by "Buy Volume of $Luna") as rank
from terra.core.ez_swaps
where BLOCK_TIMESTAMP>='2023-01-07' and BLOCK_TIMESTAMP<='2023-01-13'
and TX_SUCCEEDED='TRUE'
and TO_CURRENCY='uluna'
group by 1
order by 2 desc
limit 20