cybergenlab[Governance Overview] Ethereum Staking Amount per Protocol
    Updated 2024-11-16
    with validator_table_with_label as (
    select
    fv.*,
    dep.platform as platform
    from ethereum.beacon_chain.fact_validators fv
    left join ethereum.beacon_chain.ez_deposits dep
    on fv.pubkey=dep.pubkey
    where fv.validator_status='active_ongoing'
    )

    select
    date_trunc('month', fb.slot_timestamp)as date,
    platform,
    sum(effective_balance) as "ETH staked"
    from validator_table_with_label
    join ethereum.beacon_chain.fact_blocks fb
    on validator_table_with_label.slot_number = fb.slot_number
    where fb.slot_timestamp < date_trunc('month', current_date())
    and fb.slot_timestamp >= dateadd(year, -1, date_trunc('month', current_date()))
    and platform not in ('not labeled')
    group by 1,2
    order by 1,3 desc

    /*¨
    select * from validator_table_with_label
    limit 10

    , total_staked_table as (
    select
    sum(effective_balance) as total_staked
    from ethereum.beacon_chain.fact_validators
    where block_number in ( select max(block_number) from ethereum.beacon_chain.fact_validators)
    )


    , historical_daily_table as (
    QueryRunArchived: QueryRun has been archived