Moesmg
Updated 2022-10-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
›
⌄
select * , amount_dep - amount_with as net_amount
from (with sushi_pools as
(select
POOL_ADDRESS ,pool_name
from
ethereum.core.dim_dex_liquidity_pools
where PLATFORM ilike 'sushiswap')
,deps as
(select
'Deposit' as type,
pool_name,
sum(amount_usd) as amount_dep
from
ethereum.core.ez_token_transfers t
join sushi_pools p on to_address = pool_address
where AMOUNT_USD is not null
and block_timestamp::date between '2022-09-01' and '2022-09-29'
and origin_function_signature in ('0xf305d719','0xe8e33700')
group by 1,2)
,wits as
(
select
'Withdraw' as type,
pool_name,
sum(amount_usd) as amount_with
from
ethereum.core.ez_token_transfers t
join sushi_pools p on from_address = pool_address
where
block_timestamp between '2022-09-01' and '2022-09-29'
Run a query to Download Data