Afonso_DiazBy Swap Pair
Updated 2025-04-14
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
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
QueryRunArchived: QueryRun has been archived