cypherThorchain comparision first vs last 30 days
    Updated 2022-04-21
    with first_n_pools as (select
    'n_pools' as label,
    count(distinct(iff(charindex('-', pool_name) = 0, pool_name, LEFT(pool_name, CHARINDEX('-', pool_name) - 1)))) as first
    from thorchain.daily_pool_stats
    where day >= '2021-4-11' and day <= '2021-5-11'),

    last_n_pools as (select
    'n_pools' as label,
    count(distinct(iff(charindex('-', pool_name) = 0, pool_name, LEFT(pool_name, CHARINDEX('-', pool_name) - 1)))) as last
    from thorchain.daily_pool_stats
    where day >= current_date - 30),

    n_pools as (select * from first_n_pools
    full outer join last_n_pools using (label)),

    first_n_swaps as (select
    'n_swaps' as label,
    count(distinct(tx_id)) as first
    from thorchain.swaps
    where block_timestamp >= '2021-4-11' and block_timestamp <= '2021-5-11'),

    last_n_swaps as (select
    'n_swaps' as label,
    count(distinct(tx_id)) as last
    from thorchain.swaps
    where block_timestamp >= current_date - 30),

    n_swaps as (select * from first_n_swaps
    full outer join last_n_swaps using (label)),

    first_swaps_volume as (select
    'swaps_volume' as label,
    sum(from_amount_usd) as first
    from thorchain.swaps
    where block_timestamp >= '2021-4-11' and block_timestamp <= '2021-5-11'),

    Run a query to Download Data