Afonso_DiazOvertime
    Updated 2025-03-04
    with

    main as (
    select
    tx_id,
    block_timestamp,
    trader as user,
    nvl(amount_in_usd, amount_out_usd) as amount_usd,
    token_in_symbol as symbol_in,
    token_out_symbol as symbol_out
    from
    flow.defi.ez_dex_swaps
    where
    amount_usd <= 1e6
    and platform ilike 'increment%'
    ),

    overtime as (
    select
    date_trunc('{{ period }}', block_timestamp) as date,
    count(distinct tx_id) as swaps,
    count(distinct user) as users,
    sum(amount_usd) as volume_usd,
    avg(amount_usd) as average_amount_usd
    from main
    group by 1
    ),

    new_users as (
    select
    date_trunc('{{ period }}', min_date) as date,
    count(distinct user) as new_user
    from (
    select
    user,
    min(block_timestamp)::date as min_date
    Last run: 2 months ago
    DATE
    SWAPS
    USERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    NEW_USERS
    RETURNING_USERS
    CUMULATIVE_SWAPS
    CUMULATIVE_VOLUME_USD
    1
    2023-12-01 00:00:00.0003033989729743.69109427187.49837900798903033729743.69109427
    2
    2024-01-01 00:00:00.0002569721490873.293877141145.83282646438333856021220616.98497141
    3
    2024-02-01 00:00:00.0003424729483435.363410859108.2479541926646390261704052.34838227
    4
    2024-03-01 00:00:00.00046709365083594.21591437655.778407626396540136966787646.56429664
    5
    2024-04-01 00:00:00.000698919663306224.03789517276.04776136713376292068510093870.6021918
    6
    2024-05-01 00:00:00.00037474782012756.41436864266.4138205651043742443212106627.0165605
    7
    2024-06-01 00:00:00.0002862450982522.496516211167.866478134773732729413089149.5130767
    8
    2024-07-01 00:00:00.0003420636580105.93668828480.213763371874493071413669255.449765
    9
    2024-08-01 00:00:00.00037899493448737.99268622495.6507606623605893450317117993.4424512
    10
    2024-09-01 00:00:00.00022484892271306.3145515810.891222617923973675119389299.7570027
    11
    2024-10-01 00:00:00.00024265021036434.31564561360.123111761203823917720425734.0726483
    12
    2024-11-01 00:00:00.00025786141706579.41339791553.1861955911794354175522132313.4860462
    13
    2024-12-01 00:00:00.00024375513210266.174003711000.3945696491643874419225342579.6600499
    14
    2025-01-01 00:00:00.00024684133000725.01922682978.390942037943194666028343304.6792767
    15
    2025-02-01 00:00:00.00017072971581823.67900042694.08673936642334836729925128.3582771
    16
    2025-03-01 00:00:00.000309110973581.3983544052024.07775125714964867630898709.7566315
    16
    2KB
    3s