Updated 2022-10-25
    with poolstvl as (
    select date as day,
    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 tx_id) as TX_Count,
    count (distinct liquidity_provider_address) as Users_Count
    --sum (amount*usdprice/pow(10,decimal)) as Volume,
    --sum (volume) over (partition by wallet_type order by date) as Cumulative_Volume
    from osmosis.core.fact_liquidity_provider_actions t1 join poolstvl t2 on t1.block_timestamp::date = t2.day and t1.currency = t2.pool
    where tx_status = 'SUCCEEDED' and currency ilike '%pool%'
    and pool_id = '674'
    group by 1,2
    order by 1
    Run a query to Download Data