datavortexfascinating-red
    Updated 5 days ago
    WITH monthly_growth AS (
    SELECT
    DATE_TRUNC('month', block_timestamp) AS month,
    COUNT(DISTINCT tx_id) AS monthly_swap_count,
    LAG(COUNT(DISTINCT tx_id)) OVER (
    ORDER BY
    DATE_TRUNC('month', block_timestamp)
    ) AS prev_month_swap_count,
    (
    COUNT(DISTINCT tx_id) - LAG(COUNT(DISTINCT tx_id)) OVER (
    ORDER BY
    DATE_TRUNC('month', block_timestamp)
    )
    ) * 100 / NULLIF(
    LAG(COUNT(DISTINCT tx_id)) OVER (
    ORDER BY
    DATE_TRUNC('month', block_timestamp)
    ),
    0
    ) AS monthly_growth_percentage
    FROM
    sei.defi.ez_dex_swaps
    GROUP BY
    month
    )
    SELECT
    month,
    monthly_swap_count,
    monthly_growth_percentage
    FROM
    monthly_growth
    WHERE
    MONTHLY_GROWTH_PERCENTAGE IS NOT NULL
    ORDER BY
    month ASC;
    Last run: 5 days ago
    MONTH
    MONTHLY_SWAP_COUNT
    MONTHLY_GROWTH_PERCENTAGE
    1
    2023-09-01 00:00:00.00013739-31.239678
    2
    2023-10-01 00:00:00.0004362-68.250964
    3
    2023-11-01 00:00:00.000796282.530949
    4
    2023-12-01 00:00:00.0002013772429.226325
    5
    2024-01-01 00:00:00.000431890114.468385
    6
    2024-02-01 00:00:00.00074490-82.752553
    7
    2024-03-01 00:00:00.000199672168.052088
    8
    2024-04-01 00:00:00.00076060-61.907528
    9
    2024-05-01 00:00:00.00048744-35.913752
    10
    2024-06-01 00:00:00.0009472194.323404
    11
    2024-07-01 00:00:00.000245926159.631972
    12
    2024-08-01 00:00:00.00042452572.623065
    13
    2024-09-01 00:00:00.000323311-23.841705
    14
    2024-10-01 00:00:00.00040709425.914058
    15
    2024-11-01 00:00:00.000923472126.844906
    16
    2024-12-01 00:00:00.0009503312.90848
    17
    2025-01-01 00:00:00.000806651-15.118943
    18
    2025-02-01 00:00:00.00089215310.599627
    19
    2025-03-01 00:00:00.000871594-2.304425
    20
    2025-04-01 00:00:00.000126074644.648311
    21
    950B
    4s