Muzeccc
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 through_staking_protocol AS (
SELECT traces."from" AS address, 'RocketPool' AS protocol
FROM ethereum.transactions txs
RIGHT JOIN ethereum.traces traces ON txs.hash=traces.tx_hash AND traces.to='\x00000000219ab540356cbb839cbe05303d7705fa'
WHERE txs."to" IN ('\xdcd51fc5cd918e0461b9b7fb75967fdfd10dae2f', '\x1cc9cf5586522c6f483e84a19c3c2b0b6d027bf0')
),
all_stakers_data AS (
SELECT et."from"::text AS address
, sn.name AS project_name_known
--, llp.name AS project_name
, SUM(value)/1e18 AS deposited_eth
, SUM(CASE
WHEN et.block_time < (current_timestamp - interval '7 days')
THEN value
ELSE 0
END)/1e18 AS deposited_eth_last_week
, SUM(CASE
WHEN et.block_time < (current_timestamp - interval '30 days')
THEN value
ELSE 0
END)/1e18 AS deposited_eth_last_month
, MIN(block_time) AS first_deposit
, MAX(block_time) AS last_deposit
, tsp.protocol AS liquid_staking_protocol
FROM ethereum.traces et
LEFT JOIN staker_names sn ON et."from"=sn.address
--LEFT JOIN labels.labels llp ON et."from"=llp.address AND llp."type"='project'
LEFT JOIN through_staking_protocol tsp ON et."from"=tsp.address
WHERE "to" = '\x00000000219ab540356cBB839Cbe05303d7705Fa'
AND success
AND value > 0
GROUP BY et."from", project_name_known, tsp.protocol
),
Run a query to Download Data