nimasadjadiDeposit Distribution of ETHs in BendDAO
    Updated 2022-09-07
    with Ether_price as (
    select date_trunc(day,hour)::date daily_price_time ,
    avg (price) price
    from ethereum.core.fact_hourly_token_prices
    where symbol ='WETH'
    group by 1
    ),
    BendDAO as (select
    origin_from_address,
    sum (event_inputs:value/pow(10,18)) volume,
    sum ((event_inputs:value/pow(10,18))*price) volume_usd
    from ethereum.core.fact_event_logs
    join Ether_price on block_timestamp::date = daily_price_time
    where origin_to_address = '0x3b968d2d299b895a5fcf3bba7a64ad0f566e6f88'
    and block_timestamp::date >= CURRENT_DATE - 30
    and event_name = 'Transfer'
    and origin_function_signature in ('0x58c22be7') and contract_name = 'WETH9'
    group by 1
    )
    select case when volume BETWEEN 0 and 1 then '0 - 1 ETH'
    when volume BETWEEN 1 and 2 then '1 - 2 ETH'
    when volume BETWEEN 2 and 3 then '2 - 3 ETH'
    when volume BETWEEN 3 and 4 then '3 - 4 ETH'
    when volume BETWEEN 4 and 5 then '4 - 5 ETH'
    when volume BETWEEN 5 and 10 then '5 - 10 ETH'
    when volume BETWEEN 10 and 1 then '10 - 15 ETH'
    when volume BETWEEN 15 and 20 then '15 - 20 ETH'
    when volume BETWEEN 20 and 25 then '20 - 25 ETH'
    when volume BETWEEN 25 and 30 then '25 - 30 ETH'
    else 'greater than 30 ETH'
    end as range ,
    count (origin_from_address) num_wallets
    from BendDAO
    group by 1
    Run a query to Download Data