binhachonSeasonality - Lunar New Year
    Updated 2022-03-13
    with swap_transaction as (
    select
    tx_id,
    count(*) as frequency
    from ethereum.dex_swaps
    where platform like '%sushi%'
    group by tx_id
    ),
    swap_gas as (
    select
    block_timestamp,
    tx_fee
    from ethereum.transactions
    where tx_id in (select tx_id from swap_transaction where frequency = 2)
    and block_timestamp > '2022-01-14 00:00:00.000'
    and block_timestamp < '2022-02-14 00:00:00.000'
    )
    select
    date_trunc('day', block_timestamp) as time,
    case when time >= '2022-01-30 00:00:00.000' and time <= '2022-02-07 00:00:00.000' then 'Festive season' else 'Normal' end as season,
    avg(tx_fee) as average_fee,
    count(*) as number_of_txs
    from swap_gas group by time, season

    Run a query to Download Data