chill1e
Updated 2023-04-29
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
with part1 as
(select AMOUNT_IN as amount , ORIGIN_FROM_ADDRESS as address , BLOCK_TIMESTAMP::date as dates
from ethereum.core.ez_dex_swaps
where SYMBOL_IN='USDC' and SYMBOL_OUT='UNI' and PLATFORM='uniswap-v3')
, part2 as
(select AMOUNT_IN as amount , ORIGIN_FROM_ADDRESS as address , BLOCK_TIMESTAMP::date as dates
from ethereum.core.ez_dex_swaps
where SYMBOL_IN='UNI' and SYMBOL_OUT='USDC' and PLATFORM='uniswap-v3')
, part3_4 as
(select AMOUNT_IN_USD as amount , ORIGIN_FROM_ADDRESS as address , BLOCK_TIMESTAMP::date as dates
from ethereum.core.ez_dex_swaps
where PLATFORM='uniswap-v3' AND AMOUNT_IN_USD > 0 AND
((SYMBOL_IN='USDC' and SYMBOL_OUT='UNI') or (SYMBOL_IN='UNI' and SYMBOL_OUT='USDC'))
)
select sum(amount) , count(distinct address) , trunc(dates, 'WEEK') from part1
group by 3
Run a query to Download Data