cyphereth deposit distribution
    Updated 2022-09-03
    with data as (select
    date_trunc('day', block_timestamp) as day,
    tx_hash,
    event_inputs:to as staker,
    event_inputs:value/1e18 as amount

    from ethereum.core.fact_event_logs
    where contract_address = lower('0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84')
    and event_inputs:from = '0x0000000000000000000000000000000000000000'),

    amounts as (
    select amount
    from data
    ),

    final_values as (select
    count(case when amount <= 0.01 then 1 end) as "a) less than 0.01 ETH",
    count(case when amount > 0.01 and amount <= 0.1 then 1 end) as "b) 0.01 - 0.1 ETH",
    count(case when amount > 0.1 and amount <= 1 then 1 end) as "c) 0.1 - 1 ETH",
    count(case when amount > 1 and amount <= 10 then 1 end) as "d) 1 - 10 ETH",
    count(case when amount > 10 and amount <= 50 then 1 end) as "e) 10 - 50 ETH",
    count(case when amount > 50 and amount <= 100 then 1 end) as "f) 50 - 100 ETH",
    count(case when amount > 100 and amount <= 1000 then 1 end) as "g) 100 - 1000 ETH",
    count(case when amount > 1000 and amount <= 5000 then 1 end) as "h) 1000 - 5000 ETH",
    count(case when amount > 5000 and amount <= 10000 then 1 end) as "i) 5000 - 10000 ETH",
    count(case when amount > 10000 then 1 end) as "j) 10000+ ETH"
    from amounts)

    select bin, n, rank() over (order by bin asc) as rank_
    from final_values
    unpivot(
    n
    for bin in (
    "a) less than 0.01 ETH",
    "b) 0.01 - 0.1 ETH",
    "c) 0.1 - 1 ETH",
    Run a query to Download Data