keshansold POEPLE
    Updated 2022-11-27
    --select * from ethereum.udm_events
    -- where contract_address = '0x7a58c0be72be218b41c608b7fe7c5bb630736c71'
    --and to_address = '0x0000000000000000000000000000000000000000'
    --and event_name = 'transfer'

    select from_address as address, sum(amount) as amount_sold, sum(usd_value) as usd_sold
    from
    (select from_address, amount,
    case
    when amount_usd is null then (0.00436 * amount)
    else amount_usd
    end as usd_value
    from ethereum.udm_events
    /*inner join ethereum.token_prices_hourly
    on ethereum.token_prices_hourly.hour = date_trunc('hour', ethereum.udm_events.block_timestamp)
    and ethereum.token_prices_hourly.token_address = '0x7a58c0be72be218b41c608b7fe7c5bb630736c71' */
    where contract_address = '0x7a58c0be72be218b41c608b7fe7c5bb630736c71'
    and to_address != '0x0000000000000000000000000000000000000000'
    and from_address != '0x0000000000000000000000000000000000000000'
    and event_name = 'transfer')
    group by 1
    --order by 2 desc
    Run a query to Download Data