Ali3NWeekly Qi Swaps Stats on Avalanche Over Time
    Updated 2025-03-26
    -- forked from Weekly Qi Swaps Stats on Avalanche Over Time @ https://flipsidecrypto.xyz/edit/queries/25ea3abd-2e14-4c50-9005-525b915dfe13

    select date_trunc ({{Time_Interval}},block_timestamp) as date,
    case when token_in = '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5' then 'Swap From Qi'
    when token_out = '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5' then 'Swap To Qi' end as Trading_Type,
    count (distinct tx_hash) as TX_Count,
    count (distinct origin_from_address) as Traders_Count,
    sum (case when token_in = '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5' then amount_in
    when token_out = '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5' then amount_out end) as Trading_Volume,
    avg (case when token_in = '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5' then amount_in
    when token_out = '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5' then amount_out end) as Average_Trading_Volume,
    sum (tx_count) over (partition by Trading_Type order by date) as Cumulative_TX_Count,
    sum (Trading_Volume) over (partition by Trading_Type order by date) as Cumulative_Trading_Volume
    from avalanche.defi.ez_dex_swaps
    where token_in in ('0x8729438eb15e2c8b576fcc6aecda6a148776c0f5')
    or token_out = '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5'
    group by 1,2
    order by 1 desc




    Last run: about 1 month ago
    DATE
    TRADING_TYPE
    TX_COUNT
    TRADERS_COUNT
    TRADING_VOLUME
    AVERAGE_TRADING_VOLUME
    CUMULATIVE_TX_COUNT
    CUMULATIVE_TRADING_VOLUME
    1
    2025-03-01 00:00:00.000Swap To Qi7407492426237728.60335450991.47369342753008722705565517.0696
    2
    2025-03-01 00:00:00.000Swap From Qi9588759476962462.56889445347.25827808564130322973147959.2473
    3
    2025-02-01 00:00:00.000Swap From Qi159021143626114061.35019932273.92068815563171522496185496.6784
    4
    2025-02-01 00:00:00.000Swap To Qi16017865627904494.31630832559.21671331652268022279327788.4662
    5
    2025-01-01 00:00:00.000Swap From Qi107781198372972838.19547429707.11574635461581321870071435.3282
    6
    2025-01-01 00:00:00.000Swap To Qi106081395360344473.14308129384.69160426350666321651423294.1499
    7
    2024-12-01 00:00:00.000Swap From Qi168241956704075913.49528533831.9116570760503521497098597.1327
    8
    2024-12-01 00:00:00.000Swap To Qi148552102712432482.01452638788.72336334349605521291078821.0068
    9
    2024-11-01 00:00:00.000Swap To Qi118217621727483247.61323126296.47957400448120020578646338.9923
    10
    2024-11-01 00:00:00.000Swap From Qi1344612011750459472.45915111501.33591051358821120793022683.6374
    11
    2024-10-01 00:00:00.000Swap To Qi5306912956992008.143725152460.0936982246937918851163091.3791
    12
    2024-10-01 00:00:00.000Swap From Qi6038898963040720.782447138447.48717401557476519042563211.1783
    13
    2024-09-01 00:00:00.000Swap To Qi5779464871984563.802026126871.02630612946407317894171083.2353
    14
    2024-09-01 00:00:00.000Swap From Qi8132878886521255.70743495335.11729298156872718079522490.3958
    15
    2024-08-01 00:00:00.000Swap From Qi13740983865474771.13566956086.758546856059517193001234.6884
    16
    2024-08-01 00:00:00.000Swap To Qi10457518870063427.94063471906.06842484645829417022186519.4333
    17
    2024-07-01 00:00:00.000Swap From Qi133561220472577805.46232732178.79650431254685516327526463.5527
    18
    2024-07-01 00:00:00.000Swap To Qi10992560489774748.17064339584.15486710144783716152123091.4927
    19
    2024-06-01 00:00:00.000Swap To Qi11326518295944500.53985521915.32142623343684515662348343.322
    20
    2024-06-01 00:00:00.000Swap From Qi131151164304605131.75832619712.99066517853349915854948658.0904
    88
    9KB
    7s