Afonso_Diaztop new conreacts (txs)
    Updated 2024-10-22
    with

    new_contracts as (
    select
    receiver_id as contract_address,
    block_timestamp as created_at
    from near.core.fact_actions_events
    where action_name = 'DeployContract'
    having created_at >= current_date - interval '1 month'
    ),

    transactions as (
    select
    tx_hash,
    block_timestamp,
    receiver_id as contract_address,
    tx_signer as user,
    transaction_fee / 1e24 as tx_fee
    from near.core.fact_actions_events_function_call
    join near.core.fact_transactions
    using (tx_hash)
    where contract_address in (select distinct contract_address from new_contracts)
    and block_timestamp::date >= current_date - interval '1 month'
    )

    select
    contract_address,
    count(distinct tx_hash) as transactions,
    count(distinct user) as users,
    sum(tx_fee) as total_fee
    from transactions
    group by 1
    order by total_fee desc
    limit 10

    QueryRunArchived: QueryRun has been archived