sarathpoolofthe_week5
    Updated 2022-12-04
    with pricet as (
    select recorded_at::date as day,
    address,
    symbol,
    avg (price) as USDPrice
    from osmosis.core.dim_prices t1 join osmosis.core.dim_labels t2 on t1.symbol = t2.project_name
    where symbol != 'IOV'
    group by 1,2,3
    union all
    select recorded_at::date as day,
    'ibc/92BE0717F4678905E53F4E45B2DED18BC0CB97BF1F8B6A25AFEDF3D5A879B4D5' as address1,
    'IST' as symbol1,
    '1' as USDPrice
    from osmosis.core.dim_prices
    --where symbol = 'OSMO'
    group by 1,2,3),

    newtable as (
    select liquidity_provider_address as New_LPer,
    min (block_timestamp) as mindate
    from osmosis.core.fact_liquidity_provider_actions
    where tx_status = 'SUCCEEDED'
    and pool_id = '837'
    and action = 'pool_joined'
    group by 1),

    maintable as (
    select block_Timestamp::date as date,
    case when date < '2022-11-15' then 'Before Being Chosen as Pool Of The Week'
    when date >= '2022-11-15' then 'After Being Chosen as Pool Of The Week'
    end as timespan,
    action,
    count (distinct tx_id) as TX_Count,
    count (distinct liquidity_provider_address) as Active_LPers,
    Run a query to Download Data