MLDZMNstb11
    Updated 2023-02-17
    select
    date_trunc('{{Time_basis}}',BLOCK_TIMESTAMP) as date,
    action,
    count (distinct tx_id) as no_transactions,
    count (distinct liquidity_provider_address) as no_users,
    sum(AMOUNT/pow(10,decimal)) as volume,
    avg(AMOUNT/pow(10,decimal)) as avg_volume,
    sum(no_transactions) over (partition by action order by date) as cum_swaps,
    sum(volume) over (partition by action order by date) as cum_swap_volume,
    avg(avg_volume) OVER (partition by action ORDER BY date ROWS BETWEEN 7 PRECEDING AND CURRENT ROW) as MA_7_Days
    from osmosis.core.fact_liquidity_provider_actions
    where TX_SUCCEEDED = 'TRUE' and BLOCK_TIMESTAMP>=CURRENT_DATE- {{Time_period}}
    and action in ('pool_joined','pool_exited')
    and currency = 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858'
    group by 1,2
    Run a query to Download Data