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...

    Swap Pairs on Optimism

    Introduction: Optimism is a fast and cheap layer 2 Ethereum blockchain. Sushiswap is a leading decentralized finance application with various products. In mid-May, Sushiswap rolled out support for it’s automated market maker (AMM) product for Optimism, which allows users to swap one token for another and stake their tokens in these liquidity pools to earn rewards. The purpose of this analysis is to determine the addresses of the different pools and tokens in them, as well as the token’s decimals.

    Methods:

    • Final method used to get the list of pools was connecting to the Sushiswap app manually, going to the Pools tab, opening up each pool, copy/pasting the pool address from the webpage and getting the token addresses from the URL.
    • I also tried (and failed at) the following to get the data in a more automated fashion:
      • Queried every Optimism table (transactions, events, labels, etc…) in the Flipside db, but couldn’t find anything indicating ‘Sushi’,‘Sushiswap’, etc…
      • Found a cool python package, defi crawler, that is a wrapper around the Sushiswap subgraph, but pool data wasn’t available yet for Optimism.
      • Get the pool data from the Sushi analytics dashboard, like Polygon, but pool data wasn’t available yet for Optimism.

    Conclusion

    • The current manual solution used to get the address is a good one-time solution, but should automate in the future with either (1) python scrapper/crawler, or (2) setup a subgraph to get the data. I’d recommend #2 because it’s less hacky, more sustainable, more web3, and many people can use the subgraph for other purposes.
    • 50%+ of Sushi swaps on Optimism occur in the ETH / stablecoin pools.
    db_img
    db_img
    Loading...
    Loading...

    After getting the pool/token address & token names, queried the swap events in the optimism.core.fact_event_logs table, and found ETH to stablecoins is > 50% of swaps.

    Manually pulled the pool & token addresses from Sushiswap app, then joined to optimism.core.dim_contracts to get the token symbols and decimals.