rackhaelContracts on near
    Updated 2022-08-04
    WITH total AS(
    SELECT a.tx_hash ,
    action_name,
    a.block_timestamp,tx_receiver
    FROM near.core.fact_transactions a JOIN near.core.fact_actions_events b ON a.tx_hash=b.tx_hash
    WHERE action_name = 'DeployContract'
    ),
    c AS(SELECT tx_receiver,
    min(block_timestamp) date
    FROM total GROUP BY tx_receiver
    ),
    d AS(SELECT distinct tx_receiver
    FROM c
    )
    SELECT distinct tx_receiver ,
    count(tx_hash) txn
    FROM near.core.fact_transactions
    WHERE tx_receiver IN (SELECT tx_receiver FROM d)
    AND block_timestamp >= '2022-01-01'
    GROUP BY tx_receiver
    ORDER BY txn DESC
    limit 5
    Run a query to Download Data