SELECT
CASE
when RECEIVER Ilike '%terra%' then 'terra' WHEN RECEIVER Ilike '%kujira%' THEN 'kujira'
WHEN RECEIVER Ilike '%osmo%' then 'osmo' WHEN RECEIVER Ilike '%juno%' then 'juno'
WHEN RECEIVER Ilike '%secret%' then 'secret' WHEN RECEIVER Ilike '%cosmos%' then 'cosmos'
WHEN RECEIVER Ilike '%stars%' then 'stargaze' WHEN RECEIVER Ilike 'ki%' then 'ki'
WHEN RECEIVER Ilike '%cre%' then 'Crescent' WHEN RECEIVER Ilike '%emoney%' then 'e-money'
END as destination,
date_trunc('week',block_timestamp) as date,
count(distinct tx_id) as tx_count
FROM axelar.core.fact_transfers
WHERE TRANSFER_TYPE = 'IBC_TRANSFER_OUT'
and (amount/pow(10,decimal)) is not null
and destination is not null
and TX_SUCCEEDED = 'TRUE'
group by 1,2
order by 3 desc