tongzzezTop 5 contracts in last 30 days
    Updated 2022-07-31
    with min_date_info as(
    select
    min(a.block_timestamp::date) as min_date,
    tx_receiver
    from
    near.core.fact_transactions a
    inner join near.core.fact_actions_events_function_call b
    on a.tx_hash = b.tx_hash
    group by
    tx_receiver
    having
    min_date >= CURRENT_DATE - 30
    and min_date < CURRENT_DATE
    )

    select
    tx_receiver,
    count(tx_hash) as num_tx

    from
    near.core.fact_transactions
    where
    tx_receiver in (select tx_receiver from min_date_info)
    and block_timestamp::date >= CURRENT_DATE - 30
    and block_timestamp::date < CURRENT_DATE
    group by
    tx_receiver
    order by
    num_tx desc

    Run a query to Download Data