ArioUser Behavior (redux) - 5 - ratio swap fee
    Updated 2022-10-25
    with Eth_swap_tx as (
    select
    distinct tx_hash
    from ethereum.sushi.ez_swaps
    where 1=1
    and BLOCK_TIMESTAMP >= CURRENT_DATE - 30
    )
    ,Ethereum_swap_fee as (
    select
    avg(TX_FEE) as "Ethereum-AVG-Swap_Fee"
    from ethereum.core.fact_transactions
    where 1=1
    and STATUS = 'SUCCESS'
    and tx_hash in (select * from Eth_swap_tx)
    and block_timestamp >= CURRENT_DATE - 30
    )
    ,OP_swap_tx as (
    select
    distinct tx_hash
    from Optimism.sushi.ez_swaps
    where 1=1
    and BLOCK_TIMESTAMP >= CURRENT_DATE - 30
    )
    ,Optimism_swap_fee as (
    select
    avg(TX_FEE) as "Optimism-AVG-Swap_Fee"
    from Optimism.core.fact_transactions
    where 1=1
    and STATUS = 'SUCCESS'
    and tx_hash in (select * from Op_swap_tx)
    and block_timestamp >= CURRENT_DATE - 30
    )
    select *,
    "Ethereum-AVG-Swap_Fee"/"Optimism-AVG-Swap_Fee" as Ratio
    from Ethereum_swap_fee join Optimism_swap_fee

    Run a query to Download Data