kalomichiCurve #2
Updated 2021-09-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
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with stETH_out as (
select
date_trunc('day', block_timestamp) as day1,
-1*sum(amount_out) as outSum_stETH,
-1*avg(amount_out) as outAvg_stETH
from ethereum.dex_swaps
where pool_name = 'stETH'
and platform = 'curve'
and token_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'
and direction = 'OUT'
group by token_address, direction, pool_name, platform, day1
order by day1 desc
limit 30),
stETH_in as (
select
date_trunc('day', block_timestamp) AS day2,
sum(amount_in) as inSum_stETH,
avg(amount_in) as inAvg_stETH
from ethereum.dex_swaps
where pool_name = 'stETH'
and direction = 'IN'
and platform = 'curve'
and token_address = lower('0xae7ab96520de3a18e5e111b5eaab095312d7fe84')
group by token_address, direction, pool_name, platform, day2
order by day2 desc
limit 30
),
stETH as (
select * from stETH_out
left JOIN stETH_in
on stETH_out.day1 = stETH_in.day2
),
WETH_out as (
Run a query to Download Data