pouya_22Liquidswap-stats-swaptype
    Updated 2 hours ago
    with stables as (
    select distinct symbol
    from external.defillama.dim_stablecoins
    )

    select
    'Swap From Stablecoins' as swap_type,
    date_trunc(week, block_timestamp) as date,
    count(distinct tx_hash) as swaps,
    sum(amount_in_usd) as swap_volume,
    sum(swaps) over(order by date) as total_swaps,
    sum(swap_volume) over(order by date) as total_swap_volume
    from aptos.defi.ez_dex_swaps
    where platform = 'liquidswap'
    and block_timestamp >= dateadd(month, -{{month}}, current_date)
    and symbol_in in (select symbol from stables)
    group by date

    union all

    select
    'Swap To Stablecoins' as swap_type,
    date_trunc(week, block_timestamp) as date,
    count(distinct tx_hash) as swaps,
    sum(amount_in_usd) as swap_volume,
    sum(swaps) over(order by date) as total_swaps,
    sum(swap_volume) over(order by date) as total_swap_volume
    from aptos.defi.ez_dex_swaps
    where platform = 'liquidswap'
    and block_timestamp >= dateadd(month, -{{month}}, current_date)
    and symbol_out in (select symbol from stables)
    group by date

    union all

    select
    Last run: about 2 hours agoAuto-refreshes every 24 hours
    SWAP_TYPE
    DATE
    SWAPS
    SWAP_VOLUME
    TOTAL_SWAPS
    TOTAL_SWAP_VOLUME
    1
    Swap From Stablecoins2024-11-11 00:00:00.00015373939161891.34016136159029679269676.288223
    2
    Swap From Stablecoins2023-07-10 00:00:00.00035774558890.80687026478357621494070.3822243
    3
    Swap To Stablecoins2023-07-10 00:00:00.000361961405196.478576183394174234359.6234444
    4
    Swap To Stablecoins2024-11-11 00:00:00.00015195139062245.41335687162127771624944.855235
    5
    Altcoin Swaps2024-11-11 00:00:00.00022105818691945.02313747051234666752990.312491
    6
    Altcoin Swaps2023-07-10 00:00:00.00018691311148.33801397853870430119504.0493234
    7
    Swap From Stablecoins2023-12-25 00:00:00.0001073992141593.92964751281937138860183.6583329
    8
    Swap From Stablecoins2024-06-03 00:00:00.0008029819093067.64444754758270440146850.656277
    9
    Swap From Stablecoins2024-10-21 00:00:00.0009948611138606.45454355819653615371440.34488
    10
    Swap From Stablecoins2024-01-15 00:00:00.000527542904337.08612834301367945415551.4017948
    11
    Swap From Stablecoins2023-07-17 00:00:00.00047098665398.80800431683067422159469.1902286
    12
    Swap To Stablecoins2023-12-25 00:00:00.0001212194854483.746146443390768119403614.166251
    13
    Swap To Stablecoins2024-10-21 00:00:00.00010164311741602.99930886822926708755200.55169
    14
    Swap To Stablecoins2024-01-15 00:00:00.000557054546830.169105153603007134199281.646798
    15
    Swap To Stablecoins2023-07-17 00:00:00.000468981328797.655558888083975563157.2790032
    16
    Swap To Stablecoins2024-06-03 00:00:00.0008422619195511.25332865703547534819818.494361
    17
    Altcoin Swaps2023-12-25 00:00:00.000605651593703.45102811167777740668326.1020744
    18
    Altcoin Swaps2024-10-21 00:00:00.00028150118328439.32125276503794621814347.422517
    19
    Altcoin Swaps2024-06-03 00:00:00.00010410424770559.70112963804977337029746.972028
    20
    Altcoin Swaps2024-01-15 00:00:00.000358761641563.18578578176468944277912.7481965
    ...
    378
    36KB
    150s