Moeopp6
    Updated 2022-09-28

    with base as (select
    block_timestamp,
    TO_ADDRESS as receiver
    from
    optimism.core.fact_token_transfers
    where --tx_hash = '0x08097aac5af6f101375039e9a16f9078fb5d2925f46abc4b088edc1115b731d7'
    ORIGIN_FUNCTION_SIGNATURE = '0x2e7ba6ef'
    and FROM_ADDRESS = '0xfedfaf1a10335448b7fa0268f56d2b44dbd357de'
    and CONTRACT_ADDRESS = '0x4200000000000000000000000000000000000042'
    )
    select
    date(t.block_timestamp) as date,symbol_in,
    count(distinct tx_hash) as txs,sum( AMOUNT_OUT) as op_amount,sum( AMOUNT_OUT_USD) as value,count(distinct ORIGIN_FROM_ADDRESS) as swappers
    from
    optimism.sushi.ez_swaps t, base b
    where TOKEN_OUT ilike '0x4200000000000000000000000000000000000042'
    and
    ORIGIN_FROM_ADDRESS in (select receiver from base)
    and
    t.block_timestamp > b.block_timestamp
    group by 1,2


    Run a query to Download Data