yasmin-n-d-r-hossss pool2
    Updated 2022-10-25
    with tvl as (
    select
    date_trunc('day', date) as date,
    currency as pool,
    sum (
    balance / pow(10, decimal)
    ) as TVL
    from
    osmosis.core.fact_daily_balances
    where
    balance_type = 'locked liquidity'
    and currency ilike '%pool%'
    and currency in (
    select
    currency
    from
    osmosis.core.fact_liquidity_provider_actions
    where
    currency ilike '%pool%'
    )
    group by
    1,
    2
    ) select
    block_timestamp :: date as date,
    tvl,
    count (
    distinct liquidity_provider_address
    ) as providers_count,
    sum(
    amount / pow(10, 18)
    ) as amount
    from
    osmosis.core.fact_liquidity_provider_actions x
    join tvl y on x.block_timestamp :: date = y.date
    and x.currency = y.pool
    Run a query to Download Data