yasmin-n-d-r-hLP ACTIVE LUNA
    Updated 2023-02-01
    with table1 as (
    select
    date_trunc (week, block_timestamp) as Week,
    TX_SENDER as Active_Users,
    count(
    distinct trunc(block_timestamp, 'month')
    ) as days_count
    from
    terra.core.fact_transactions
    WHERE
    tx_succeeded = 'True'
    group by
    1,
    2
    having
    days_count >= 1
    )
    select
    date_trunc(week, block_timestamp) as date,
    action,
    count (distinct tx_id) as TX_Count,
    sum (tx_count) over (
    order by
    date
    ) as Cumulative_TX_Count
    from
    terra.core.fact_lp_actions
    WHERE
    tx_succeeded = 'True'
    and LIQUIDITY_PROVIDER_ADDRESS in (
    select
    active_users
    from
    table1
    )
    group by
    Run a query to Download Data