BlockTrackertx_fee different chain for swap
    Updated 2023-07-17

    --For more insights and detail of analysis please check out our dashboard: https://sociocrypto.gitlab.io/Green-Routes/

    WITH
    avalanche_f as (
    SELECT
    date_trunc('day', a.block_timestamp) as date,
    sum(tx_fee*c.usd_price) as t_fee,
    avg(tx_fee*c.usd_price) as avg_fee
    FROM avalanche.core.fact_transactions a
    INNER JOIN avalanche.core.ez_dex_swaps b using(tx_hash)
    LEFT JOIN (
    SELECT
    date_trunc('d', hour) as date,
    median(price) as usd_price
    FROM avalanche.core.fact_hourly_token_prices
    WHERE symbol like 'WAVAX' -- token_address = '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7'
    GROUP BY 1
    ) c ON date_trunc('d', a.block_timestamp) = c.date
    WHERE
    date >= CURRENT_DATE -90
    GROUP BY 1
    ),
    Bsc_f as (
    SELECT
    date_trunc('day', block_timestamp) as date,
    sum(tx_fee*c.usd_price) as t_fee,
    avg(tx_fee*c.usd_price) as avg_fee
    FROM bsc.core.fact_transactions a
    INNER JOIN bsc.core.ez_dex_swaps b using(tx_hash)
    LEFT JOIN (
    SELECT
    date_trunc('d', hour) as date,
    median(price) as usd_price
    FROM bsc.core.fact_hourly_token_prices
    WHERE symbol like 'WBNB' -- token_address = '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c'
    Run a query to Download Data