Swap Pairs on Optimism

    Create a document that includes all addresses for all swap pairs for Sushiswap on Optimism plus the addresses of the two tokens belonging to each pair. Getting the decimals for each of the tokens in the pair would be a bonus. If you are using sources from sushi github, please include the link.

    Loading...
    Loading...
    db_img

    Method:

    We have 33 liquidity pools on Sushi on the Optimism network:

    so we have 33 contract addresses we have to find

    from this list we can see token contract and it’s decimals on Optimism:

    db_img
    db_img

    on the pools section we have transaction related to each pools.

    like this:

    db_img

    I used thse transaction IDs as a way to detect swap pairs contract addresses with this code:


    select CONTRACT_ADDRESS from optimism.core.fact_event_logs where TX_HASH= '0x0bf97d4ae07ff91244e1fe8d927bd4c9a3105ae00157119d6b86b7d842bd36bb' and EVENT_NAME = 'Swap' and EVENT_INPUTS:toToken = '0x4200000000000000000000000000000000000006' and EVENT_INPUTS:recipient = '0x4200000000000000000000000000000000000042’


    For example in this code I detected two Contract addresses belong to WETH-OP pairs :

    And I repeat this process and made this document :

    As we can see we have 33 pools with all details (except the OP-SNX pool because there was just one transaction and it was not in flipside tables)