Afonso_Diaztotal
Updated 2024-09-05
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
›
⌄
with t as (
select
tx_hash,
block_timestamp,
nvl(amount_in_usd, amount_out_usd) as amount_usd,
origin_from_address as swapper,
case
when block_timestamp <= '2023-10-17' then 'Before Frontend Fee'
when block_timestamp <= '2024-04-10' then '0.15 Fee'
else '0.25 Fee'
end as timespan
from ethereum.defi.ez_dex_swaps
where amount_usd <= 1e6
and platform = 'uniswap-v3'
and block_timestamp >= '2023-01-01'
)
select
timespan,
sum(amount_usd) as volume_usd,
avg(amount_usd) as average_volume_usd,
median(amount_usd) as median_volume_usd,
count(distinct swapper) as swappers,
count(distinct tx_hash) as swaps,
swaps / count(distinct block_timestamp::date) as daily_average_swaps,
swappers / count(distinct block_timestamp::date) as daily_average_swappers
from t
group by 1
QueryRunArchived: QueryRun has been archived