ArioMK-Avg and Med
Updated 2023-09-15
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
select
avg(case
when AMOUNT_IN_USD is not null then AMOUNT_IN_USD
when AMOUNT_IN_USD is null
and AMOUNT_OUT_USD is not null then AMOUNT_OUT_USD
else (AMOUNT_IN * price)
end) as "Avg Swap Volume"
,median(case
when AMOUNT_IN_USD is not null then AMOUNT_IN_USD
when AMOUNT_IN_USD is null
and AMOUNT_OUT_USD is not null then AMOUNT_OUT_USD
else (AMOUNT_IN * price)
end) as "Median Swap Volume"
from
base.defi.ez_dex_swaps
join base.price.ez_hourly_token_prices on TOKEN_IN = TOKEN_ADDRESS
and date_trunc(hour, block_timestamp) = HOUR
where
platform = 'maverick'
and block_timestamp::date >= '2023-08-09'
Run a query to Download Data