John_GaltSCRT/OSMO: Price & Vol
    Updated 2022-07-14
    with poolfilter as (select
    distinct tx_id,
    date(block_timestamp) as date,
    msg_index as index
    from osmosis.core.fact_msg_attributes
    where date(block_timestamp) > '2022-04-12'
    --where date(block_timestamp) > DATEADD(month, -3, current_date) --use this later
    and msg_type = 'token_swapped'
    and attribute_key = 'pool_id'
    and attribute_value = 584
    ),
    osmoin as (select --osmoin
    SPLIT_PART(attribute_value, 'u', 1) / pow(10, 6) as osmo_in,
    tx_id,
    msg_index as index
    from osmosis.core.fact_msg_attributes
    where date(block_timestamp) > '2022-04-12'
    and msg_type = 'token_swapped'
    and attribute_key = 'tokens_in'
    and CONTAINS(attribute_value, 'uosmo')
    ),
    osmoout as (select --osmoout
    SPLIT_PART(attribute_value, 'u', 1) / pow(10, 6) as osmo_out,
    tx_id,
    msg_index as index
    from osmosis.core.fact_msg_attributes
    where date(block_timestamp) > '2022-04-12'
    and msg_type = 'token_swapped'
    and attribute_key = 'tokens_out'
    and CONTAINS(attribute_value, 'uosmo')
    ),

    osmousd as (select
    block_timestamp,
    Run a query to Download Data