Updated 2022-07-06
    with polygon_fee as (select sum(fee_usd) as fee ,date_trunc('month', block_timestamp) as fee_date from flipside_prod_db.polygon.transactions
    group by fee_date)
    , eth_fee as (select sum(tx_fee) as fee,date_trunc('month', block_timestamp) as fee_date from ethereum.core.fact_transactions
    group by fee_date)
    , eth_price as (select avg(price) as eth_price,hour as price_date from ethereum.core.fact_hourly_token_prices
    where token_address is null
    group by price_date)

    ,eth_fee_usd as (select (fee*eth_price) as eth_fee_USD,fee_date from eth_fee inner join eth_price on fee_date=price_date)

    select polygon_fee.fee as polygon_fee_USD ,eth_fee_USD, polygon_fee.fee_date as date from polygon_fee inner join eth_fee_usd
    on eth_fee_usd.fee_date=polygon_fee.fee_date


    Run a query to Download Data