misaghlbETH Down Bad - swap
Updated 2022-11-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 eth_price_tbl as (
select date_trunc('day', hour) as pdate, avg(price) as eth_price
from ethereum.core.fact_hourly_token_prices
where SYMBOL = 'WETH'
and pdate >= '2022-11-01'
group by pdate
),
swap_data as (
select
block_timestamp,
tx_hash,
SENDER as trader,
AMOUNT_OUT_USD as usd_vol
from ethereum.core.ez_dex_swaps
where SYMBOL_OUT = 'WETH'
and date(block_timestamp) >= '2022-11-01'
and AMOUNT_OUT_USD > 0
UNION ALL
select
block_timestamp,
tx_hash,
SENDER as trader,
AMOUNT_IN_USD as usd_vol
from ethereum.core.ez_dex_swaps
where SYMBOL_IN = 'WETH'
and date(block_timestamp) >= '2022-11-01'
and AMOUNT_IN_USD > 0
),
swap_agg as (
SELECT date(block_timestamp) as date,
count(distinct tx_hash) as swaps,
count(distinct trader) as wallets,
sum(usd_vol) as usd_vol,
avg(usd_vol) as avg_usd_vol
Run a query to Download Data