Afonso_DiazTop swap routes
    Updated 4 hours 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: about 4 hours ago
    SWAP_ROUTE
    SWAPS
    SWAPPERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    1
    wNEAR - USDC1564830279015351896135.084446224.015669864
    2
    wNEAR - USDT.e2093492135698193454326.76736390.141934501
    3
    wNEAR - USDt3563320632478156467862.81276543.619452867
    4
    wNEAR - FRAX4223215728189970137.484064212.816610608
    5
    wNEAR - STNEAR85566841679163903.8457796866.818179134
    6
    wNEAR - USDC.e5472359265250076122.337968891.404971695
    7
    wNEAR - LINEAR969453766739674045.2120612402.492063711
    8
    wNEAR - PURGE4678731037032695925.864875468.548510645
    9
    wNEAR - ZEC28395038831598552.4565028110.677942054
    10
    wNEAR - ETH54062813645022135417.8136940.277410892
    10
    612B
    422s