with t1 as (
select
tx_from,
min(block_timestamp) as min_date
from osmosis.core.fact_transactions
group by tx_from
)
select
pool_id[0] as pool_id,
count(*) as liquidity_providers_count
from osmosis.core.fact_liquidity_provider_actions
left outer join t1
on tx_from = liquidity_provider_address
and block_timestamp = min_date
where tx_from is not null
group by pool_id
order by liquidity_providers_count desc