gokcinprotocols
    Updated 2022-11-11
    SELECT
    date_trunc('day', block_timestamp) as date,
    INITCAP(l.PROJECT_NAME, ' ') as "Protocol",
    COUNT(DISTINCT ORIGIN_FROM_ADDRESS) as "User Count",
    COUNT(DISTINCT tx_hash) as "TX Count",
    sum("TX Count") over (partition by "Protocol" order by date) as "Cum Protocol TX Cnt"
    FROM optimism.core.fact_event_logs
    JOIN optimism.core.dim_labels l ON ADDRESS = ORIGIN_TO_ADDRESS
    WHERE TX_STATUS = 'SUCCESS'
    AND contract_address ILIKE '0x4200000000000000000000000000000000000042' and date>= current_date - 160
    GROUP BY 1, 2
    ORDER BY 1, 2
    Run a query to Download Data