PERIOD | Total $GUI Swaps | Total $GUI Swap Volume | Average $GUI Swap Size | Median $GUI Swap Size | Total Swappers/Traders | |
---|---|---|---|---|---|---|
1 | ⌚last_24_hours | 💱495 | 💲7547.98913322 | 💲15.279330229 | 💲0.559715792 | 👤80 |
2 | ⌚last_7_days | 💱7875 | 💲150970.054647681 | 💲19.22450715 | 💲0.4810986788 | 👤612 |
3 | ⌚All time | 💱1530725 | 💲86381421.6640462 | 💲56.96566333 | 💲0.08209606114 | 👤56769 |
Kruys-Collinsthundering-teal copy
Updated 2025-03-23
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 swaps AS (
SELECT
*,
DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day,
CASE
WHEN BLOCK_TIMESTAMP >= DATEADD(hour, -24, CURRENT_TIMESTAMP) THEN 'last_24_hours'
WHEN BLOCK_TIMESTAMP >= DATEADD(day, -7, CURRENT_TIMESTAMP) THEN 'last_7_days'
ELSE 'All time'
END AS period
FROM aptos.defi.ez_dex_swaps
WHERE
token_in = '0xe4ccb6d39136469f376242c31b34d10515c8eaaa38092f804db8e08a8f53c5b2::assets_v1::EchoCoin002'
OR token_out = '0xe4ccb6d39136469f376242c31b34d10515c8eaaa38092f804db8e08a8f53c5b2::assets_v1::EchoCoin002'
),
metrics AS (
SELECT
period,
COUNT(*) AS total_GUI_swaps,
SUM(amount_in_usd) AS total_GUI_swap_volume,
AVG(amount_in_usd) AS average_GUI_swap_size,
MEDIAN(amount_in_usd) AS median_GUI_swap_size,
COUNT(DISTINCT swapper) AS total_unique_GUI_swappers
FROM swaps
GROUP BY period
)
SELECT
'⌚' || period as Period,
'💱' || COALESCE(total_GUI_swaps, 0) AS "Total $GUI Swaps",
'💲' || COALESCE(total_GUI_swap_volume, 0) AS "Total $GUI Swap Volume",
'💲' || COALESCE(average_GUI_swap_size, 0) AS "Average $GUI Swap Size",
'💲' || COALESCE(median_GUI_swap_size, 0) AS "Median $GUI Swap Size",
'👤' || COALESCE(total_unique_GUI_swappers, 0) AS "Total Swappers/Traders"
FROM metrics
ORDER BY
CASE
WHEN period = 'last_24_hours' THEN 1
Last run: about 1 month ago
3
301B
3s