mlhUntitled Query
    Updated 2022-07-26
    select *
    from (select *,
    row_number() over (partition by date order by total_fee desc) as rank_fee,
    row_number() over (partition by date order by gas desc) as rank_gas
    from (select date_trunc('day',BLOCK_TIMESTAMP) as date,
    TX_RECEIVER,
    sum(fee) as total_fee,
    sum(used_gas) as gas,
    count(*) as total_txs
    from (SELECT BLOCK_TIMESTAMP,
    TX_RECEIVER,
    TRANSACTION_FEE/1e24 as fee,
    gas_used/1e12 as used_gas,
    TX_HASH
    FROM near.core.fact_transactions
    where BLOCK_TIMESTAMP>= CURRENT_DATE - 7
    )
    group by 1, 2
    order by 3 desc
    )
    )
    where rank_gas<=10
    order by 3 desc
    Run a query to Download Data