Updated 2023-02-22

    with
    main as (
    select
    ORIGIN_FROM_ADDRESS as claimer ,
    RAW_AMOUNT/pow(10,18) as volume ,
    BLOCK_TIMESTAMP::date as date ,
    TX_HASH as claim
    from optimism.core.fact_token_transfers
    where
    ORIGIN_TO_ADDRESS ='0xfedfaf1a10335448b7fa0268f56d2b44dbd357de' and
    CONTRACT_ADDRESS = '0x4200000000000000000000000000000000000042' and
    FROM_ADDRESS ='0xfedfaf1a10335448b7fa0268f56d2b44dbd357de' and
    ORIGIN_FUNCTION_SIGNATURE ='0x2e7ba6ef'
    )
    select
    BLOCK_TIMESTAMP::date , sum(AMOUNT_IN) ,SYMBOL_OUT ,
    count (distinct claimer )
    from main inner join optimism.velodrome.ez_swaps on claimer = ORIGIN_FROM_ADDRESS
    where BLOCK_TIMESTAMP > date and 0 <AMOUNT_IN and ( AMOUNT_IN < volume or AMOUNT_IN = volume) and SYMBOL_IN = 'OP'
    group by 1,3
    Run a query to Download Data