chrisfdto dex weekly copy
Updated 2023-10-19
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
›
⌄
-- forked from iamgroot / to dex weekly @ https://flipsidecrypto.xyz/iamgroot/q/wrXTcYyRw8Pz/to-dex-weekly
select
sum(a.amount) as token_amount,
sum(a.amount_usd) as amount_usd,
count(distinct a.origin_from_address) as users,
count(distinct a.tx_hash) as transactions,
date_trunc('week', a.block_timestamp) as date
from
ethereum.core.ez_token_transfers a
join ethereum.core.fact_transactions b on b.tx_hash = a.tx_hash
join ethereum.core.dim_labels d on d.address = a.to_address
where
lower(d.label_type) = 'dex'
and lower(a.symbol) = 'uni'
and d.label_type is not null
and a.amount_usd is not null
and a.amount_usd > 0
and b.status = 'SUCCESS'
group by
date
order by
date desc
Run a query to Download Data