jp127 [OSMO] In The Stars - Swap TO over time
    Updated 2022-05-27
    WITH tx as (
    SELECT BLOCK_TIMESTAMP::date as date, tx_id, split_part(ATTRIBUTE_VALUE, 'ibc/', 0) / 1e6 as amount
    FROM osmosis.core.fact_msg_attributes
    WHERE msg_type = 'token_swapped' and msg_index = 21
    and ATTRIBUTE_KEY = 'tokens_out' and split_part(ATTRIBUTE_VALUE, 'ibc/', 2) = '987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
    )

    SELECT date, COUNT(DISTINCT tx_id) as daily_tx, SUM(daily_tx) OVER (ORDER BY date ASC) as total_tx,
    SUM(amount) as daily_amount, SUM(daily_amount) OVER (ORDER BY date ASC) as total_amount
    FROM tx
    WHERE date > '2022-03-20'
    GROUP BY 1
    Run a query to Download Data