ErsvanHigher average gas cost and the contract
    Updated 2022-07-26
    select day, TX_SIGNER, avg as "Average gas spent by users" from (
    select
    ROW_NUMBER() OVER (partition by date_trunc('day',BLOCK_TIMESTAMP) order by AVG(GAS_USED/pow(10,12)) desc) AS RN,
    date_trunc('day',BLOCK_TIMESTAMP) as day,
    TX_SIGNER,
    AVG(GAS_USED/pow(10,12)) as avg,
    CASE
    WHEN day >= (CURRENT_DATE - 7) and day < CURRENT_DATE then 'Last week'
    WHEN day >= (CURRENT_DATE - 30) and day < CURRENT_DATE -7 THEN 'Last month'
    else null
    end as timeframe
    from flipside_prod_db.mdao_near.transactions
    where timeframe is not null
    group by TX_SIGNER, day
    order by day asc, avg desc
    )
    where RN = 1
    order by day asc
    Run a query to Download Data