with metamask_wallet_address_list as (
select
distinct origin_from_address as user_address
from ethereum.core.ez_dex_swaps
where origin_to_address= '0x881d40237659c251811cec9c364ef91dc08d300c'
and origin_function_signature = '0x5f575529'
group by user_address
)
select
sum(balance) as total_metamask_wallet_user_balance,
avg(balance) as average_metamask_wallet_user_balance
from ethereum.erc20_balances
where balance_date = current_date - 1
and contract_address = 'ETH'
and symbol = 'ETH'
and label is null
and user_address in (select user_address from metamask_wallet_address_list)