NuveveCryptoArchivedUntitled Query
Updated 2021-08-02Copy Reference Fork
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
35
36
›
⌄
with swap_raw as (
select
block_timestamp,
pool_address,
pool_name,
case when amount0_usd < 0 then amount0_usd else amount1_usd end as swap_usd_amount_out,
case when amount0_usd >= 0 then amount0_usd else amount1_usd end as swap_usd_amount_in
from uniswapv3.swaps
where amount0_usd is not null and amount1_usd is not null
),
number1 as (
select
date_trunc('week', block_timestamp) as week,
sum(abs(swap_usd_amount_in)) as USDC_WETH_500_10
from swap_raw
where pool_address = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'
group by 1
order by 1 desc
limit 10
),
number2 as (
select
date_trunc('week', block_timestamp) as week,
sum(abs(swap_usd_amount_in)) as USDC_WETH_3000_60
from swap_raw
where pool_address = '0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8'
group by 1
order by 1 desc
limit 10
),
number3 as (
select
date_trunc('week', block_timestamp) as week,
Run a query to Download Data