nsa2000Daily amount of ETH swaps for derivatives tokens thereof
Updated 2022-09-13Copy Reference Fork
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
›
⌄
select block_timestamp::date as date, case
when token = '0xe95a203b1a91a908f9b9ce46459d101078c2c3cb' then 'aETH'
when token = '0xae78736cd615f374d3085123a210448e74fc6393' then 'rETH'
when token = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' then 'stETH'
end as tokens,
count(distinct origin_from_address) as "unique users",
count(distinct tx_hash) as "tx numbers",
sum (case when token = '0xe95a203b1a91a908f9b9ce46459d101078c2c3cb' and amount > 1e6 then (amount / 1e18)
else amount end) as ETH_amount,
sum(usd_amount) as "USD amount"
from
(
select
BLOCK_TIMESTAMP,
TX_HASH,
ORIGIN_FROM_ADDRESS,
TOKEN_IN as token,
AMOUNT_IN as amount,
AMOUNT_IN_USD as usd_amount
from ethereum.core.ez_dex_swaps
where token_in in ('0xe95a203b1a91a908f9b9ce46459d101078c2c3cb','0xae78736cd615f374d3085123a210448e74fc6393','0xae7ab96520de3a18e5e111b5eaab095312d7fe84')
union
select
BLOCK_TIMESTAMP,
TX_HASH,
ORIGIN_FROM_ADDRESS,
TOKEN_OUT as token,
AMOUNT_OUT as amount,
AMOUNT_OUT_USD as usd_amount
from ethereum.core.ez_dex_swaps
where token_out in ('0xe95a203b1a91a908f9b9ce46459d101078c2c3cb','0xae78736cd615f374d3085123a210448e74fc6393','0xae7ab96520de3a18e5e111b5eaab095312d7fe84')
)
group by 1,2
Run a query to Download Data