hessDaily Swap
Updated 2023-09-04
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
›
⌄
with swap_out as ( select *
from avalanche.defi.ez_dex_swaps
where symbol_in = 'JOE'
and block_timestamp::date >= current_date - 90
UNION
select *
from arbitrum.defi.ez_dex_swaps
where symbol_in = 'JOE'
and block_timestamp::date >= current_date - 90)
,
swap_in as ( select *
from avalanche.defi.ez_dex_swaps
where symbol_out = 'JOE'
and block_timestamp::date >= current_date - 90
UNION
select *
from arbitrum.defi.ez_dex_swaps
where symbol_out = 'JOE'
and block_timestamp::date >= current_date - 90)
select date(block_timestamp) as date, 'Sell' as type, count(DISTINCT(origin_from_address)) as users, count(DISTINCT(tx_hash)) as total_tx, sum(amount_in_usd) as volume
from swap_out
where symbol_in = 'JOE'
and block_timestamp::date >= current_date - 90
group by 1,2
UNION
select date(block_timestamp) as date, 'Buy' as type, count(DISTINCT(origin_from_address)) as users, count(DISTINCT(tx_hash)) as total_tx, sum(amount_out_usd) as volume
from swap_in
where symbol_out = 'JOE'
and block_timestamp::date >= current_date - 90
group by 1,2