Soheil_MKUntitled Query
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 from_ETH as (
select
BLOCK_TIMESTAMP::date as date,
count(distinct TX_HASH) as txs,
count(distinct ORIGIN_FROM_ADDRESS) as users,
sum(AMOUNT_IN_USD) as usd_value
from ethereum.core.ez_dex_swaps
where SYMBOL_IN ='WETH'
and EVENT_NAME='Swap'
and date>='2022-11-01'
group by 1
),
to_ETH as (
select
BLOCK_TIMESTAMP::date as date,
count(distinct TX_HASH) as txs,
count(distinct ORIGIN_FROM_ADDRESS) as users,
sum(AMOUNT_IN_USD) as usd_value
from ethereum.core.ez_dex_swaps
where SYMBOL_OUT ='WETH'
and EVENT_NAME='Swap'
and date>='2022-11-01'
group by 1
)
select
a.date,
-1*a.usd_value as from_ETH_USD_Value,
b.usd_value as to_ETH_USD_Value,
sum(-1*a.usd_value+b.usd_value) over (order by a.date) as cum_usd_value
from from_ETH a
Run a query to Download Data