with cte1 as (SELECT *
from ethereum.core.dim_dex_liquidity_pools
where PLATFORM='sushiswap'),
cte2 as (SELECT
count(distinct ORIGIN_FROM_ADDRESS) as total_unique_LP_providers
from ethereum.core.ez_token_transfers
where TO_ADDRESS in (select POOL_ADDRESS from cte1)
and ORIGIN_TO_ADDRESS='0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f'
and origin_function_signature in ('0xe8e33700', '0xded9382a', '0xf305d719')
),
cte3 as (select
count(distinct ORIGIN_FROM_ADDRESS) as Yield_farmers
from ethereum.core.ez_token_transfers
where ORIGIN_TO_ADDRESS='0xef0881ec094552b2e128cf945ef17a6752b4ec5d' and ORIGIN_FUNCTION_SIGNATURE='0x8dbdbe6d')
select
total_unique_LP_providers,
Yield_farmers,
Yield_farmers/total_unique_LP_providers as ratio
from cte2 , cte3