MLDZMNvel7
    Updated 2022-08-03
    with tb1 as (select
    *
    from optimism.core.fact_token_transfers
    where ORIGIN_TO_ADDRESS='0x7af14adc8aea70f063c7ea3b2c1ad0d7a59c4bff' and ORIGIN_FUNCTION_SIGNATURE='0xf10f1f58'
    -- and ADDRESS_NAME='rubicon: rubicon router'
    ),


    tb2 as (select
    tx_hash,
    SYMBOL as first_pair
    from tb1 x
    join optimism.core.dim_contracts y on x.CONTRACT_ADDRESS=y.ADDRESS
    where ORIGIN_FROM_ADDRESS=FROM_ADDRESS
    ),

    tb3 as (select
    tx_hash,
    SYMBOL as second_pair
    from tb1 z
    join optimism.core.dim_contracts c on z.CONTRACT_ADDRESS=c.ADDRESS
    where ORIGIN_FROM_ADDRESS=TO_ADDRESS
    ),


    tb4 as (select
    tb3.tx_hash,
    first_pair,
    second_pair,
    CONCAT(first_pair,' / ',second_pair) as asset_pairs
    from tb3
    join tb2 on tb2.tx_hash=tb3.tx_hash
    )


    select
    Run a query to Download Data