KingTigerMafia-7mwRZbUntitled Query
    Updated 2022-11-07
    WITH top_20 AS
    (SELECT tb2.PROJECT_NAME AS project_name,
    count(DISTINCT tx_hash) AS tx,
    count(DISTINCT origin_from_address) AS users
    FROM optimism.core.fact_event_logs AS tb1
    JOIN optimism.core.dim_labels AS tb2 ON tb1.origin_to_address = tb2.address
    GROUP BY 1
    ORDER BY 2 DESC
    LIMIT 10)
    SELECT block_timestamp::date AS date,
    tb2.PROJECT_NAME,
    count(DISTINCT tx_hash) AS tx,
    count(DISTINCT origin_from_address) AS users
    FROM optimism.core.fact_event_logs AS tb1
    JOIN optimism.core.dim_labels AS tb2 ON tb1.origin_to_address = tb2.address
    WHERE project_name in
    (SELECT project_name
    FROM top_20)
    AND date<CURRENT_DATE
    GROUP BY 1, 2
    Run a query to Download Data