nitsSTARS inflow
    Updated 2022-06-01
    SELECT hour(block_timestamp) as hr, sum(net_am) as total_amt,
    sum(total_amt) over (order by hr) as cumulative_amt
    from
    (SELECT *, replace(attribute_value, 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4', '') as net_am from
    (SELECT *
    from osmosis.core.fact_msg_attributes where tx_id in
    (SELECT tx_id from osmosis.core.fact_msg_attributes
    where msg_type = 'token_swapped')
    and tx_id in (
    SELECT tx_id from osmosis.core.fact_msg_attributes
    where attribute_key = 'tokens_in' and contains(attribute_value, 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'))
    and attribute_key = 'amount'
    and contains(attribute_value, 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4')))
    where msg_type = 'coin_spent'
    GROUP by 1
    limit 1000

    --

    Run a query to Download Data