with DAI as (select --date_trunc('day',block_timestamp) as date,
to_varchar (event_inputs:pool) as pool_type,
sum(event_inputs:amount/1e18) as amount_DAI_pool
from ethereum.events_emitted
where tx_to_address = '0xafd2aade64e6ea690173f6de59fc09f5c9190d74'
and event_name = 'PoolAllocation' and event_inputs:amount/1e18 is not null
group by 1),
USDC as (select --date_trunc('day',block_timestamp) as date,
to_varchar (event_inputs:pool) as pool_type,
sum(event_inputs:amount/1e6) as amount_USDC_pool
from ethereum.events_emitted
where tx_to_address = '0x66f4856f1bbd1eb09e1c8d9d646f5a3a193da569'
and event_name = 'PoolAllocation' and event_inputs:amount/1e6 is not null
and event_inputs:amount/1e6 < 400000000000000000
group by 1)
select DAI.pool_type, amount_DAI_pool, amount_USDC_pool
from DAI join USDC on DAI.pool_type = USDC.pool_type