alirsOPB-OPT10-swap amount-number
    Updated 2022-10-14
    with zipswap as (
    select
    DISTINCT tx_hash
    from optimism.core.fact_event_logs
    where
    origin_to_address= lower('0xE6Df0BB08e5A97b40B21950a0A51b94c4DbA0Ff6') --ZipSwap
    and event_name = 'Swap'
    and tx_status = 'SUCCESS'
    )
    select
    count(DISTINCT tx_hash) as swap_count
    ,sum(EVENT_INPUTS:value/pow(10,DECIMALS)) as Swap_amount
    from optimism.core.fact_event_logs
    join optimism.core.dim_contracts on address = CONTRACT_ADDRESS
    where
    EVENT_NAME='Transfer'
    and tx_status = 'SUCCESS'
    and EVENT_INDEX=0
    and tx_hash in (select tx_hash from zipswap)
    and BLOCK_TIMESTAMP::date>='2022-01-01'



    Run a query to Download Data