JonasoIncrement (1)
    Updated 2024-09-05
    with

    X as(
    select block_timestamp, origin_from_address as trader, case when amount_out_usd is not null then amount_out_usd else amount_in_usd end as volume
    from flow.defi.ez_dex_swaps
    where (platform like '%increment%' or platform is null)
    and year(block_timestamp) = '2024' ),

    A as(
    select date_trunc('month',block_timestamp) as time, sum(volume) as volume
    from X
    group by 1)

    select
    time, volume,
    sum(volume) over(order by time) - volume as volume_pre,
    sum(volume) over(order by time) as volume_all
    from A
    order by 1 desc

    QueryRunArchived: QueryRun has been archived