Yousefi_1994Total Deposits and Withdrawals into BendDAO
    Updated 2022-09-07
    with bend_deposit as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address,
    ((ethereum.public.udf_hex_to_int(substr(data, 3 + 1 * 64, 64)))::float) / 1e18 as amount
    from ethereum.core.fact_event_logs
    where contract_address = '0x70b97a0da65c15dfb0ffa02aee6fa36e507c2762'
    and topics[0] = '0x443ff2d25883a4800d36062db52ca3dd7ced05bd8627c8a6a37f8699715b5431'
    and contract_name is null
    and event_name is null
    and event_inputs is null
    ),
    bend_withdraw as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address,
    ((ethereum.public.udf_hex_to_int(substr(data, 3 + 0 * 64, 64)))::float) / 1e18 as amount
    from ethereum.core.fact_event_logs
    where contract_address = '0x70b97a0da65c15dfb0ffa02aee6fa36e507c2762'
    and topics[0] = '0x3ed4ee04a905a278b050a856bbe7ddaaf327a30514373e65aa6103beeae488c3'
    and contract_name is null
    and event_name is null
    and event_inputs is null
    ),
    bend_day_deposit as (
    select
    'Deposit' as type,
    count(distinct origin_from_address) as number_of_user,
    count(distinct tx_hash) as number_of_transaction,
    sum(amount) as amount
    from bend_deposit
    ),
    bend_day_withdraw as (
    select
    Run a query to Download Data