Updated 2022-08-03
    with
    contracts as (
    select count(distinct tx_hash) as Contracts
    from near.core.fact_actions_events
    where Action_Name ='CreateAccount' and BLOCK_TIMESTAMP ::date >CURRENT_DATE-30)
    ,smarts as (
    select count (distinct tx_hash) as smart
    from near.core.fact_actions_events
    where Action_Name ='DeployContract' and BLOCK_TIMESTAMP ::date >CURRENT_DATE-30)

    ,contract as (
    select block_timestamp::date as date,
    count (distinct tx_hash) as Contracts
    from near.core.fact_actions_events
    where Action_Name ='CreateAccount' and BLOCK_TIMESTAMP ::date >CURRENT_DATE-30
    group by 1
    )

    ,smart as (
    select block_timestamp::date as date,
    count (distinct tx_hash) as smart
    from near.core.fact_actions_events
    where Action_Name ='DeployContract'and BLOCK_TIMESTAMP ::date >CURRENT_DATE-30
    group by 1
    ),
    top as (
    select tx_receiver,
    count (distinct tx_hash)
    from near.core.fact_transactions where BLOCK_TIMESTAMP ::date >CURRENT_DATE-30
    group by 1
    order by 2 DESC
    limit 5
    )
    select * from contract

    Run a query to Download Data