datavortexTop swap token by swaps 24hr
Updated 2024-09-18
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
›
⌄
WITH recent_data AS (
SELECT
block_timestamp,
tx_hash,
origin_from_address,
COALESCE(amount_in_usd, 0) AS amount_in_usd,
symbol_in
FROM optimism.defi.ez_dex_swaps
WHERE block_timestamp >= CURRENT_TIMESTAMP() - INTERVAL '1 DAY'
),
aggregated_data AS (
SELECT
symbol_in AS symbol,
COUNT(DISTINCT tx_hash) AS total_swaps,
COUNT(DISTINCT origin_from_address) AS total_swappers,
SUM(amount_in_usd) AS total_swap_volume
FROM recent_data
GROUP BY symbol_in
)
SELECT
symbol,
total_swaps,
total_swappers,
total_swap_volume
FROM aggregated_data
WHERE total_swap_volume IS NOT NULL
ORDER BY total_swap_volume DESC
LIMIT 11;
QueryRunArchived: QueryRun has been archived