select
case event_inputs:pool
when '100' then 'Fuse Pool 4'
when '101' then 'Fuse Pool 7'
when '102' then 'Fuse Pool 13'
when '103' then 'Fuse Pool 14'
when '104' then 'Fuse Pool 15'
when '1' then 'Aave'
when '2' then 'Compound'
when '106' then 'Fuse Pool 11'
when '108' then 'Fuse Pool 18'
when '109' then 'Fuse Pool 6'
end as FusePools,
sum(event_inputs:amount)/pow(10,6) as USDCAmount
from ethereum_core.fact_event_logs
where lower(contract_address) = lower('0x66f4856f1bbd1eb09e1c8d9d646f5a3a193da569')
and EVENT_NAME='PoolAllocation'
and FusePools<>'3'
and ORIGIN_FUNCTION_SIGNATURE='0xd42ec3fe'
group by 1