SalehPolygon Fees-compare Polygon & Ethereum
    Updated 2022-07-08
    with lst_polygon_price as (
    select
    HOUR::date as day
    ,avg(PRICE ) as price
    from ethereum.core.fact_hourly_token_prices
    where token_address =lower( '0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0' )
    group by 1
    )
    , lst_Ethereum_price as (
    select
    HOUR::date as day
    ,avg(PRICE ) as price
    from ethereum.core.fact_hourly_token_prices
    where symbol ='WETH'
    group by 1
    )
    , lst_Polygon as (
    select
    block_timestamp::date as day
    ,p.day
    ,count(DISTINCT tx_hash ) as tx_count
    ,count(DISTINCT FROM_ADDRESS) as wallets
    ,sum(TX_FEE*price) as amount_fee
    ,sum(amount_fee) over(order by day) as growth_fee
    from polygon.core.fact_transactions f
    join lst_polygon_price p on p.day =block_timestamp::date
    where block_timestamp::date>='2022-07-01'
    group by 1,2
    order by 1
    )
    ,lst_Ethereum as (

    select
    block_timestamp::date as day
    ,p.day
    Run a query to Download Data