select
event_inputs:pool as pool_number,
sum(event_inputs:amount)/pow(10,18) as DAI_amount,
case
when pool_number='101' then 'Fuse Pool 7'
when pool_number='100' then 'Fuse Pool 6'
when pool_number='102' then 'Fuse Pool 18'
else 'Other_Pools'
end as pool_number
from flipside_prod_db.ethereum_core.fact_event_logs
where lower(contract_address) = lower('0xafd2aade64e6ea690173f6de59fc09f5c9190d74')
AND TX_STATUS = 'SUCCESS'
and event_inputs:amount > 0
AND event_inputs:pool > 100
group by 1