Afonso_DiazTop swap routes
    Updated 2 days ago
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    trader as swapper,
    platform,
    symbol_in,
    symbol_out,
    nvl(amount_in_usd, amount_out_usd) as amount_usd
    from
    near.defi.ez_dex_swaps
    where
    block_timestamp between '{{ start_date }}' and '{{ end_date }}'
    and 'wrap.near' in (token_in_contract, token_out_contract)
    and amount_usd < 1e6

    )

    select
    greatest(symbol_in, symbol_out) || ' - ' || least(symbol_in, symbol_out) as swap_route,
    count(distinct tx_hash) as swaps,
    count(distinct swapper) as swappers,
    sum(amount_usd) as volume_usd,
    avg(amount_usd) as average_amount_usd
    from
    main
    where
    amount_usd > 0
    and swap_route is not null
    group by 1
    order by volume_usd desc
    limit 10
    Last run: 2 days ago
    SWAP_ROUTE
    SWAPS
    SWAPPERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    1
    wNEAR - USDC1540782278658339768836.038036219.685749465
    2
    wNEAR - USDT.e2004329134898186274026.70399690.801507771
    3
    wNEAR - USDt3476040631202150841912.55142143.113641348
    4
    wNEAR - FRAX4075625711686830478.0177488212.825537007
    5
    wNEAR - STNEAR83564834778189846.098461877.354646527
    6
    wNEAR - USDC.e5403109250849950777.995611892.343601577
    7
    wNEAR - LINEAR965283761039341262.9390869400.999540701
    8
    wNEAR - PURGE4076321019029652514.682960371.808462468
    9
    wNEAR - ETH53611213633021853649.493400140.14632037
    10
    wNEAR - UWON190613662009821682398.564555211.336561682
    10
    617B
    477s