datavortextRADING VOLUME
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
›
⌄
WITH recent_data AS (
SELECT
block_timestamp,
tx_hash,
origin_from_address,
amount_in_usd,
token_in
FROM optimism.defi.ez_dex_swaps
WHERE block_timestamp >= CURRENT_TIMESTAMP() - INTERVAL '1 DAY'
)
SELECT
COUNT(DISTINCT tx_hash) AS total_swaps,
COUNT(DISTINCT origin_from_address) AS total_swappers,
SUM(amount_in_usd) AS total_swap_volume,
COUNT(DISTINCT token_in) AS total_tokens,
ROUND(AVG(amount_in_usd), 2) AS average_swap_volume
FROM recent_data;
QueryRunArchived: QueryRun has been archived