JonasoPangolin (2)
    Updated 2024-10-30
    with

    A as(
    select sum(case when amount_out_usd is not null then amount_out_usd else amount_in_usd end) as volume
    from avalanche.defi.ez_dex_swaps
    where year(block_timestamp) = '2024'
    and platform like '%pangolin%' ),

    B as(
    select sum(case when amount_out_usd is not null then amount_out_usd else amount_in_usd end) as volume
    from avalanche.defi.ez_dex_swaps
    where year(block_timestamp) = '2024' ),

    C as(
    select 'Pangolin' as tag, volume from A union all
    select 'Avax Dex' as tag, volume - (select volume from A) from B)

    select *, volume/sum(volume) over()*100 as ratio from C















    QueryRunArchived: QueryRun has been archived