Afonso_DiazBy Swap Pair
    Updated 3 days ago
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    trader as swapper,
    symbol_in,
    symbol_out,
    platform,
    iff(amount_in_usd < 1e6, amount_in_usd, amount_out_usd) as amount_usd
    from
    near.defi.ez_dex_swaps a
    where
    tx_hash in (
    select distinct tx_hash
    from near.core.fact_actions_events_function_call b
    where try_parse_json(args:msg):referral_id = 'owner.herewallet.near'
    and a.tx_hash = b.tx_hash and a.block_timestamp = b.block_timestamp
    )
    )

    select
    symbol_in || ' -> ' || symbol_out as token_pair,
    COUNT(DISTINCT tx_hash) AS unique_swaps,
    COUNT(DISTINCT swapper) AS unique_swappers,
    SUM(amount_usd) AS total_swapped_volume,
    AVG(amount_usd) AS avg_swapped_volume
    from
    main
    where
    amount_usd > 0
    and token_pair is not null
    group by 1
    order by total_swapped_volume desc
    limit 10
    Last run: 3 days ago
    TOKEN_PAIR
    UNIQUE_SWAPS
    UNIQUE_SWAPPERS
    TOTAL_SWAPPED_VOLUME
    AVG_SWAPPED_VOLUME
    1
    wNEAR -> USDt6137623568306824770.034786711.11948025
    2
    wNEAR -> UWON5612843012026090397.6175788910.850772631
    3
    USDt -> wNEAR4675502198705817293.6699796212.44173228
    4
    UWON -> wNEAR3924331872865723255.2568184614.583511294
    5
    wNEAR -> USDC105017677673428320.5037971932.640413049
    6
    USDt -> USDC85924356453006416.1727066534.983955371
    7
    USDC -> USDt91175421732949545.9357888732.348606446
    8
    USDC -> wNEAR83767399692804128.7022034233.468147069
    9
    USDT.e -> USDt100597414261890368.5282267418.790752858
    10
    USDt -> USDC.e73144256041885197.4182726225.77272367
    10
    607B
    309s