winnie-fsETH in Beacon Chain copy
Updated 2023-04-14
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
›
⌄
-- forked from tomwanhh / ETH in Beacon Chain @ https://staging.flipsidecrypto.xyz/tomwanhh/q/2023-03-26-10-10-pm-b9cYez
with
balance as (
select block_number,
ROW_NUMBER() OVER(ORDER BY block_number asc) as index,
sum(balance) as balance,
sum(effective_balance) as effective_balance,
sum(case when validator_status = 'active_ongoing' then 1 else 0 end) as validator_count,
sum(case when validator_status in
('exited_unslashed','exited_slashed','withdrawal_possible') then 1 else 0 end) as exited_validators,
sum(case when slashed=TRUE then 1 else 0 end) as slashed,
sum(case when substr("WITHDRAWAL_CREDENTIALS", 1, 4)='0x01' then 1 else 0 end)
as "0x01 Credentials",
sum(case when substr("WITHDRAWAL_CREDENTIALS", 1, 4)='0x00' then 1 else 0 end)
as "0x00 Credentials",
sum(case when balance>60 then 1 else 0 end) as double_deposit
from ethereum.beacon_chain.fact_validators
group by 1
),
price as (
select date_trunc('day',hour) as day,avg(price) as price
from crosschain.core.ez_hourly_prices
where symbol = 'WETH'
and blockchain = 'ethereum'
and hour>=date('2022-09-15')
group by 1
),
day as (
select date_day as day,
ROW_NUMBER() OVER(ORDER BY date_day asc) as index
from ethereum.core.dim_dates
where date_day>=date('2022-09-15')
and date_day<=date(current_date())
Run a query to Download Data