intensodefiUntitled Query
    Updated 2022-01-26
    WITH biggest_losers as (
    SELECT
    tx_from_address as losers,
    sum(event_inputs:amount / pow(10,24)) as amount_eth_token
    FROM ethereum.events_emitted
    WHERE block_timestamp>'2021-11-01' and event_inputs:controller = '0xd569d3cce55b71a8a3f3c418c329a66e5f714431' and event_inputs:projectId = 36
    AND event_name = 'Redeem'
    group by 1
    order by 2 desc
    LIMIT 5
    ),tx as(
    select tx_id from ethereum.events_emitted
    WHERE block_timestamp>'2021-11-01' and event_inputs:controller = '0xd569d3cce55b71a8a3f3c418c329a66e5f714431' and event_inputs:projectId = 36
    AND event_name = 'Redeem' and tx_from_address in (select losers from biggest_losers) and block_timestamp>'2021-11-01')
    select * from ethereum.udm_events
    where tx_id in (select * from tx)

    Run a query to Download Data