JonasoRef Finance (8)
    Updated 2024-10-21
    select
    case when month(block_timestamp) in ('1','2','3') then 'Q1'
    when month(block_timestamp) in ('4','5','6') then 'Q2'
    when month(block_timestamp) in ('7','8','9') then 'Q3'
    else 'Q4' end as tag,
    year(block_timestamp) as year,
    round(sum(case when amount_out_usd is not null then amount_out_usd else amount_in_usd end)) as volume,
    from near.defi.ez_dex_swaps
    where platform = 'v2.ref-finance.near'
    group by 1,2
    order by year desc, tag desc

    QueryRunArchived: QueryRun has been archived