scottincryptoAave FEI Swapper
    Updated 2023-03-31
    -- select
    -- *
    -- from ethereum.core.fact_decoded_event_logs
    -- where contract_address = lower('0x7842186CDd11270C4Af8C0A99A5E0589c7F249ce')
    -- order by block_timestamp desc

    select
    *
    from ethereum.core.ez_token_transfers
    where 1=1
    and tx_hash = '0x403f4d6d9c4c9c14de803181cbd98243f1b11ef922afcfeedbaef9074bafde3c'
    and block_timestamp = '2022-10-09 15:20:47.000' --makes the query faster


    -- with afei_sent as (
    -- select
    -- date_trunc('day', block_timestamp) as block_day
    -- , amount as afei_converted
    -- from ethereum.core.ez_token_transfers
    -- where 1=1
    -- and tx_hash = '0x403f4d6d9c4c9c14de803181cbd98243f1b11ef922afcfeedbaef9074bafde3c'
    -- and block_timestamp = '2022-10-09 15:20:47.000' --makes the query faster
    -- and from_address = '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c'
    -- and symbol = 'aFEI'
    -- )

    -- , adai_received as (
    -- select
    -- date_trunc('day', block_timestamp) as block_day
    -- , sum(amount) as adai_received
    -- from ethereum.core.ez_token_transfers
    -- where 1=1
    -- and tx_hash = '0x403f4d6d9c4c9c14de803181cbd98243f1b11ef922afcfeedbaef9074bafde3c'
    -- and block_timestamp = '2022-10-09 15:20:47.000' --makes the query faster
    -- and to_address = '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c'
    -- and symbol = 'aDAI'
    Run a query to Download Data