chill7e
Updated 2023-04-29
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
-- forked from 1e @ https://flipsidecrypto.xyz/edit/queries/9eb026ce-6eed-4009-a1b8-de0e4f3ad01a
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 count(1) , sum(amount) , count(distinct address) , trunc(dates, 'WEEK') from part3_4
group by 4
Run a query to Download Data