Afonso_DiazTotal
Updated 2024-05-30
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
›
⌄
with main as (
select
tx_hash,
'Uniswap' as program,
block_timestamp,
origin_from_address as user,
amount_in_usd as amount_usd
from
ethereum.defi.ez_dex_swaps
where
block_timestamp :: date >= '2021-01-01'
and platform ilike 'uniswap%'
union
select
tx_id,
'Thorchain' as program,
block_timestamp,
from_address as user,
from_amount_usd as amount_usd
from
thorchain.defi.fact_swaps
where
block_timestamp :: date >= '2021-01-01'
)
select
program,
count(distinct(tx_hash)) as txns,
count(distinct(user)) as users,
sum(amount_usd) as volume,
avg(amount_usd) as avg_volume
from
main
group by
1
QueryRunArchived: QueryRun has been archived