feyikemiFlow Revenue
    Updated 2024-05-09
    -- Credit to apostleoffinance and kruys-collins their analysis on Revenue Growth was helpful in putting this together.

    WITH q4_revenue_23 AS (
    SELECT
    SUM(total_fees_usd) AS total_q4_revenue
    FROM
    flow.stats.ez_core_metrics_hourly
    WHERE
    total_fees_usd IS NOT NULL
    AND
    DATE_PART('quarter', block_timestamp_hour) = 4
    AND
    DATE_PART('year', block_timestamp_hour) = 2023
    ),
    q1_revenue_24 AS (
    SELECT
    SUM(total_fees_usd) AS total_q1_revenue
    FROM
    flow.stats.ez_core_metrics_hourly
    WHERE
    total_fees_usd IS NOT NULL
    AND
    DATE_PART('quarter', block_timestamp_hour) = 1
    AND
    DATE_PART('year', block_timestamp_hour) = 2024
    ),

    Growth_Rate AS (
    SELECT
    total_q1_revenue,
    total_q4_revenue,
    q1.total_q1_revenue - q4.total_q4_revenue AS revenue_growth,
    ((q1.total_q1_revenue - q4.total_q4_revenue) / q4.total_q4_revenue) * 100 AS revenue_growth_rate
    FROM
    q4_revenue_23 q4,
    q1_revenue_24 q1;
    QueryRunArchived: QueryRun has been archived