nitsMost Popular Fund Raising Events
    Updated 2022-06-26
    with tx as
    (SELECT DISTINCT tx_hash from ethereum.core.fact_event_logs
    where contract_address = lower('0xcA69d7aE5F6a5A3FdBB66b2C6cAA1a2928c7CD2f')),
    ctr as
    (SELECT DISTINCT contract_address as contracts
    from ethereum.core.fact_event_logs
    where tx_hash in (SELECT * from tx))

    SELECT * from
    (SELECT * from
    ( SELECT contract_address, count(DISTINCT tx_hash) as total_calls, sum(event_inputs:amount/pow(10,18)) as amt from
    ethereum.core.fact_event_logs
    where contract_address in (SELECT * from ctr )
    -- and event_name ilike '%Contribut%'
    GROUP by 1
    ORDER by 2 desc )
    left join ethereum.core.dim_contracts
    on address = contract_address )
    where symbol is not NULL
    order by 2 desc
    -- select date(block_timestamp) as day, sum(amt) as total_amt,
    -- sum( total_amt) over (ord er by day) as cumulative_amt from
    -- (SELECT *, event_inputs:amount/pow(10,18) as amt from ethereum.core.fact_event_logs
    -- WHERE contract_address in (SELECT * from ctr) and event_name = 'Contribution')
    -- GROUP by 1
    -- -- order by 3
    -- -- where tx_hash = '0xebe96fe53b240254306c11e349701aeb31c43bc512ca709f3fb771195fc19809'
    limit 300
    Run a query to Download Data