SandeshUntitled Query
Updated 2022-09-21Copy Reference Fork
999
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
lido as
(with
stake as
(
select 'lido' as staker, *, 'stake' as act from ethereum.core.fact_token_transfers
where origin_to_address=lower('0x9ee91f9f426fa633d227f7a9b000e28b9dfd8599')
and to_address='0x9ee91f9f426fa633d227f7a9b000e28b9dfd8599'
and contract_address='0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'
and from_address not in ('0x5e3ef299fddf15eaa0432e6e66473ace8c13d908')
),
unstake as
(
select 'lido' as staker, *, 'unstake' as act from ethereum.core.fact_token_transfers
where
from_address='0x9ee91f9f426fa633d227f7a9b000e28b9dfd8599'
and contract_address='0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'
and to_address not in ('0x5e3ef299fddf15eaa0432e6e66473ace8c13d908')
)
-- select 'lido' as staker,(sum(stake.raw_amount)/1e18)-(sum(unstake.raw_amount)/1e18) as amt from stake, unstake
select * from stake union select * from unstake
),
stader as
(with
stake as
(
select 'stader' as staker, *, 'stake' as act from ethereum.core.fact_token_transfers
where origin_to_address=lower('0xf03A7Eb46d01d9EcAA104558C732Cf82f6B6B645')
and to_address=lower('0xf03A7Eb46d01d9EcAA104558C732Cf82f6B6B645')
and contract_address='0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'
and from_address not in ('0x5e3ef299fddf15eaa0432e6e66473ace8c13d908')
and origin_function_signature in ('0xea99c2a6')
),
unstake as
(
Run a query to Download Data