cybergenlab[DEX metrics] Average sectoral $ volume per User copy
Updated 2024-11-16
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
›
⌄
-- forked from [Ecosystem metrics] Average sectoral $ volume per User @ https://flipsidecrypto.xyz/studio/queries/102eb6f4-bf9e-4d49-bc3a-5e5b25410855
with dex_swap_vols as (
SELECT
date_trunc('month', block_timestamp::date) as ddate
, count(distinct TX_HASH) as txs
, count(distinct ORIGIN_FROM_ADDRESS) as users
, SUM(AMOUNT_IN_USD) as usd_volume
, (usd_volume/txs) as usd_volume_per_transaction
, (usd_volume/users) as usd_volume_per_user
, 'dex swaps' as label
from ethereum.defi.ez_dex_swaps
where block_timestamp >= dateadd(year, -3, date_trunc('month', current_date()))
and block_timestamp < date_trunc('month', current_date())
GROUP BY DDATE
)
SELECT
ddate
, label
, AVG(usd_volume_per_user) as usd_volume_per_user
from dex_swap_vols
GROUP BY 1,2
order by 1,3 desc
QueryRunArchived: QueryRun has been archived