Abolfazl_771025hourly swap
    Updated 2022-11-05
    select
    date_trunc('hour',block_timestamp) as date,
    'swap in' as type,
    count(tx_id) as "swap count",
    count(distinct trader) as "count of users",
    sum(FROM_AMOUNT*price/1e6) as volume
    from osmosis.core.fact_swaps ,osmosis.core.dim_labels a join osmosis.core.dim_prices b on a.label=b.symbol
    where POOL_IDS[0]=812
    and TX_STATUS='SUCCEEDED'
    and FROM_CURRENCY = 'ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'
    group by 1
    union
    select
    date_trunc('hour',block_timestamp) as date,
    'swap out' as type,
    count(tx_id) as "swap count",
    count(distinct trader) as "count of users",
    sum(TO_AMOUNT*price/1e6) as volume
    from osmosis.core.fact_swaps ,osmosis.core.dim_labels a join osmosis.core.dim_prices b on a.label=b.symbol
    where POOL_IDS[0]=812
    and TX_STATUS='SUCCEEDED'
    and TO_CURRENCY = 'ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'
    group by 1
    Run a query to Download Data