adriaparcerisasATOM debut swap volume
    Updated 2022-07-14
    -- What was the swap volume in the first 24h? Show total and bar chart by hour.
    -- Show in both $USD and in $RUNE
    -- How does this compare to other pools in their first 24 hours?
    -- How many swap fees were generated?

    with pools_debuts as (
    select min(block_timestamp) as launch_time,
    TIMESTAMPADD( 'day' ,1 ,min(block_timestamp) ) as next_1_days,
    pool_name
    from thorchain.liquidity_actions
    where pool_name like ('%ATOM%') and block_timestamp>='2022-07-11'
    group by 3
    ),
    froms as (
    select
    x.pool_name,
    y.launch_time,
    y.next_1_days,
    sum(x.from_amount_usd) as usd_volume,
    sum(x.from_amount) as rune_volume
    from thorchain.swaps x
    inner join pools_debuts y on x.pool_name = y.pool_name
    where block_timestamp between y.launch_time and y.next_1_days and from_asset='THOR.RUNE'
    group by 1, 2, 3
    order by 4 desc
    ),
    tos as (
    select
    x.pool_name,
    y.launch_time,
    y.next_1_days,
    sum(x.to_amount_usd) as usd_volume,
    sum(x.to_amount) as rune_volume
    from thorchain.swaps x
    inner join pools_debuts y on x.pool_name = y.pool_name
    where block_timestamp between y.launch_time and y.next_1_days and to_asset='THOR.RUNE'
    Run a query to Download Data