maybeyonasnear_function_pops_contract
    Updated 2022-10-31
    with
    f_calls as (
    select
    t.block_timestamp,
    t.tx_hash,
    tx_receiver,
    tx_signer,
    method_name,
    args
    from near.core.fact_actions_events_function_call f
    join near.core.fact_transactions t on f.tx_hash=t.tx_hash
    ),
    first_time as (
    select
    block_timestamp
    from f_calls
    where tx_receiver = '{{CONTRACT}}'
    order by block_timestamp
    limit 1
    )

    select
    count(tx_hash) as txs,
    count(
    case when tx_receiver = '{{CONTRACT}}' then tx_hash else null end
    ) as filter_txs,
    filter_txs *100 / txs as percent
    from f_calls
    where block_timestamp > (select block_timestamp from first_time limit 1)
    limit 10
    Run a query to Download Data