jackguyflow-hackathon-2
    Updated 2023-03-23
    SELECT
    time_period,
    avg(contracts_deployed),
    median(contracts_deployed)

    FROM (
    SELECT
    day,
    CASE when day between '2023-02-10' and '2023-02-21' then 'Contest Education Phase'
    when day between '2023-02-21' and '2023-02-28' then 'Contest Build Phase'
    when day between '2023-02-28' and '2023-04-01' then 'Contest Launchpad Phase'
    else 'Non-Contest' end as time_period,
    count(*) as contracts_deployed


    FROM (
    SELECT
    event_contract,
    min(date_trunc('day', block_timestamp)) as day

    FROM flow.core.fact_events
    GROUP BY 1
    )
    GROUP BY 1,2
    )
    WHERE day > '2023-01-01'
    GROUP BY 1
    Run a query to Download Data