JonasoCellana (1)
    Updated 2024-10-13
    with

    X as(
    select date_trunc('month',block_timestamp) as time,
    sum(case when amount_out_usd is not null then amount_out_usd else amount_in_usd end) as volume
    from aptos.defi.ez_dex_swaps
    where platform = 'cellana'
    and year(block_timestamp) = '2024'
    and amount_in_usd < 1e6
    and amount_out_usd < 1e6
    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 X
    order by 1 desc


    QueryRunArchived: QueryRun has been archived