pinehearstEthereum - Beacon Deposit Contract with Event Logs
Updated 2022-11-05
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 eth2_deposit AS (
SELECT
block_timestamp,
tx_hash,
origin_from_address,
32 as eth_deposit,
event_inputs:amount as amount,
event_inputs:index as index,
event_inputs:pubkey as pubkey,
event_inputs:signature as signature,
event_inputs:withdrawal_credentials as withdrawal_credentials
FROM ethereum.core.fact_event_logs
WHERE 1=1
AND tx_status = 'SUCCESS'
AND contract_address = '0x00000000219ab540356cbb839cbe05303d7705fa' -- Beacon Deposit Contract
-- AND origin_to_address = '0x00000000219ab540356cbb839cbe05303d7705fa' -- Beacon Deposit Contract / there are lido specific
AND event_name = 'DepositEvent' -- DepositEvent
-- AND origin_function_signature = '0x22895118' -- Beacon Deposit Contract
-- AND tx_hash = '0x6b78904db0914d824f6e07f111a4cfd0678f2d16c887cd0be29737596f520eae'
-- Function: deposit(bytes pubkey, bytes withdrawal_credentials, bytes signature, bytes32 deposit_data_root)
)
SELECT
date(block_timestamp) as date,
count(tx_hash) as tx_count,
count(distinct tx_hash) as distinct_tx_count,
sum(eth_deposit) as eth,
sum(eth) over (order by date) as total_eth
FROM eth2_deposit
WHERE 1=1
AND amount IS NOT NULL
AND pubkey IS NOT NULL
AND signature IS NOT NULL
AND withdrawal_credentials IS NOT NULL
GROUP BY 1
ORDER BY 1 DESC
Run a query to Download Data