0-MIDvelodrome Vs. sushiswap, LP removers
Updated 2023-04-13
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
›
⌄
with act1 as (
with tab1 as (
select POOL_ADDRESS
from ethereum.core.dim_dex_liquidity_pools
where PLATFORM='sushiswap'),
tab2 as (
select BLOCK_TIMESTAMP::date as date,ORIGIN_FROM_ADDRESS,TO_ADDRESS
from ethereum.core.ez_token_transfers
--where CONTRACT_ADDRESS='0x397ff1542f962076d0bfe58ea045ffa2d347aca0'
where ORIGIN_TO_ADDRESS='0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f'
and SYMBOL='SLP'
and date>=current_date-90)
select date,count(distinct ORIGIN_FROM_ADDRESS)as lp_removers,sum(lp_removers)over(order by date asc)as total_lp_removers
from tab1
left join tab2
on tab1.POOL_ADDRESS=tab2.TO_ADDRESS
group by 1),
act2 as (
select BLOCK_TIMESTAMP::date as date,count(distinct ORIGIN_FROM_ADDRESS)as lp_rem
,sum(lp_rem)over(order by date asc)as total
from optimism.velodrome.ez_lp_actions
where LP_ACTION='withdraw'
and date>=current_date-90
group by 1)
select act2.date,lp_removers as sushi_lp_removers,total_lp_removers as total_sushi_lp_removers
,lp_rem as velodrome_lp_removers,total as total_velodrome_lp_removers
from act1
full outer join act2
on act1.date=act2.date
Run a query to Download Data