binhachonTop ConstitutionDAO Contributors - Number
    Updated 2022-01-27
    with constitutionDAO_txs as (
    select
    distinct tx_id
    from ethereum.events_emitted
    where contract_address = '0xd569d3cce55b71a8a3f3c418c329a66e5f714431' --Juicebox
    and event_inputs:projectId = 36
    and tx_succeeded = 'TRUE'
    ),
    total_contribution as (
    select
    from_address,
    sum(amount) as total_contribution
    from ethereum.udm_events
    where tx_id in (select tx_id from constitutionDAO_txs)
    and event_type = 'native_eth'
    group by from_address
    ),
    PEOPLE_redeem as (
    select
    from_address,
    sum(amount) / 1000000 as redeem_amount
    from ethereum.udm_events
    where contract_address = '0x7a58c0be72be218b41c608b7fe7c5bb630736c71'
    and origin_function_signature = '0x3015a5b5'
    group by from_address
    ),
    selling_tx_id as (
    select
    tx_id,
    case
    when direction = 'IN' then amount_in
    else - amount_out end
    as amount_in
    from ethereum.dex_swaps
    where token_address = '0x7a58c0be72be218b41c608b7fe7c5bb630736c71'
    ),
    Run a query to Download Data