shadilInitial swap volumes of LUNA and UST
    Updated 2022-04-14
    with luna_min_tbl as (
    SELECT
    min(date(block_timestamp)) as min_date
    from thorchain.swaps
    where pool_name like '%LUNA%'
    ),
    ust_min_tbl as (
    SELECT
    min(date(block_timestamp)) as min_date
    from thorchain.swaps
    where pool_name like '%UST%'
    ),

    -- swap volume tables
    luna_data_tbl as (
    SELECT
    date(block_timestamp) as date,
    sum(from_amount_usd) as vol,
    'luna' as type
    from thorchain.swaps
    join luna_min_tbl m
    where date(block_timestamp) BETWEEN m.min_date and dateadd(day, 2, m.min_date::date)
    and from_asset like '%LUNA%'
    group by date
    ),
    luna_to_data_tbl as (
    SELECT
    date(block_timestamp) as date,
    sum(to_amount_usd) as vol,
    'luna' as type
    from thorchain.swaps
    join luna_min_tbl m
    where date(block_timestamp) BETWEEN m.min_date and dateadd(day, 2, m.min_date::date)
    and to_asset like '%LUNA%'
    group by date
    ),
    Run a query to Download Data