MLDZMNfee_3
    Updated 2022-07-26
    with tb1 as (select
    distinct TX_RECEIVER as contracts,
    sum(GAS_USED/pow(10,12)) as GAS,
    count(TX_HASH) as no_txn,
    avg(GAS_USED/pow(10,12)) as averag_gas
    from near.core.fact_transactions
    group by 1
    order by 2 desc
    limit 10)

    select
    BLOCK_TIMESTAMP::date as day,
    TX_RECEIVER as contract,
    sum(GAS_USED/pow(10,12)) as GAS,
    count(TX_HASH) as no_txn,
    avg(GAS_USED/pow(10,12)) as averag_gas
    from near.core.fact_transactions
    where BLOCK_TIMESTAMP>=CURRENT_DATE-30
    and TX_RECEIVER in (select contracts from tb1)
    group by 1,2
    order by 1
    Run a query to Download Data