Sushiswap - Swap Pairs on Optimism
Description of Work
In this bounty, we want to obtain Sushiswap Swap Pairs on Optimism and display pairs of tokens along with their addresses and decimals for each of the tokens in the pair. To do this, we examine the following:
- Total Sushiswap Swap Pairs on Optimism
- Sushiswap Swap Pairs on Optimism list
- Daily Sushiswap Swap Pairs on Optimism swap transactions over time
- Top Sushiswap Swap Pairs on Optimism by number of swap
We use the optimism.core schema, fact_event_logs and dim_contracts tables
Method
- To solve this question and find swap pairs using the data in the flipsidecrypto database, we need to find the contract address related to sushiswap routing in Optimism, so after checking and searching in optimistic.etherscan, we found the corresponding contract address:
- sushiswap routing in Optimism contract address is 0xbe811a0d44e2553d25d11cb8dc0d3f0d0e6430e6== → optimistic.etherscan (TridentRouter contract)
- Now we have to use this contract address to find the list of transactions related to sushiswap token swaps pair in Optimism and through that get the list of swap pairs and analyze and review their transactions. We use the fact_event_logs table available in optimism.core schema. To obtain swap pairs, we must first find the list of their transactions, which we use the following method:
select concat(event_inputs:recipient, ',', event_inputs:toToken
→ Get pair token addresswhere origin_to_address = '0xbe811a0d44e2553d25d11cb8dc0d3f0d0e6430e6'
→ TridentRouter contractevent_name = 'Swap'
→ Swap transaction
- Now we have the list of address pairs of sushiswap swap pair on optimism tokens, it is enough to get the specifications of these token addresses in the dim_contracts table, which includes the names of the tokens and their decimals.
Exception:
Loading...
Loading...
Loading...
Loading...
Final Conclusion
According to the results obtained from the data related to Swap Pair for sushiswap in Optimism, we obtained a total of 25 swap pair and displayed its information, among these 25 pairs, the number of swaps for pairs WETH/USDC, USDC/ WETH, DAI/USDC, DAI/WETH and WETH/DAI are more than other pairs