farid-c9j0VMTop 10 most used gas contracts over the last 30 days
    Updated 2022-07-27
    with
    tx_details as (
    select
    block_timestamp,
    tx_receiver,
    GAS_USED/1e12 as giga_gas
    from flipside_prod_db.mdao_near.transactions
    )

    select * from (
    select
    date(block_timestamp) as date,
    tx_receiver as contract,
    sum(giga_gas) as gas_total,
    rank() over(partition by date order by gas_total desc) as rank
    from tx_details
    group by 1,2
    order by gas_total desc
    )
    where rank <= 10
    and date between '2022-06-27' and '2022-07-26'
    Run a query to Download Data