Moesmg 0
Updated 2022-10-02
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
case when days >='2022-09-15' then 'Post Merge' else 'Pre Merge'end as date_type,* from
(with sushi_pools as
(select
POOL_ADDRESS
from
ethereum.core.dim_dex_liquidity_pools
where PLATFORM ilike 'sushiswap')
select
BLOCK_TIMESTAMP::date as days , 'Deposit' as type,
SYMBOL,
count(distinct tx_hash) as txs,
count(distinct from_address) as users,
sum(amount_usd) as amount_usd
from
ethereum.core.ez_token_transfers
where days between '2022-09-01' and '2022-09-29'
and origin_function_signature in ('0xf305d719','0xe8e33700')
and
to_address in (SELECT * from sushi_pools)
group by 1,2,3
union all
select
BLOCK_TIMESTAMP::date as days , 'Withdraw' as type,
SYMBOL,
-1*count(distinct tx_hash) as txs,
-1*count(distinct to_address) as users,
-1*sum(amount_usd) as amount_usd
from
ethereum.core.ez_token_transfers
where days between '2022-09-01' and '2022-09-29'