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 TXN_HASH ) as smart
    from flipside_prod_db.mdao_near.actions_events_function_call where METHOD_NAME ='new' and
    ACTION_NAME='FunctionCall'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 smart

    Run a query to Download Data