Sushi pairs on Avalanche and BSC

    Q108. Let's dive deep into Sushi pairs on Avalanche and BSC

    In this dashboard we will dive into:

    1. Create a document that includes all addresses for all Swap pairs on Avalanche for sushi, plus the addresses of the two tokens belonging to each pair. 
    2. Create a document that includes all addresses for all Swap pairs on the BSC chain for sushi, plus the addresses of the two tokens belonging to each pair. 
    3. Create a document that includes all addresses for all Kashi pairs on Avalanche for sushi, plus the addresses of the two tokens belonging to each pair. Ideally, define which one is the main asset and which one is the collateral. 
    4. Create a document that includes all addresses for all Kashi pairs on the BSC chain for sushi, plus the addresses of the two tokens belonging to each pair. Ideally, define which one is the main asset and which one is the collateral. 

    Methodology

    I chose to go through this dashboard by scrapping and using the links of pools in sushiswap website and to be more precise, I used the info from the following links:

    After retrieving the necessary data, from the above links, I needed to work on the JSON retrieved data so I can select the related columns to show. I used pandas library of python for this task. I will put a sample code for doing this part.

    And finally I figured probably the best way to show the results in a neat way is to share my analytics in Google sheets.

    So here are the results to four needed categories:

    Swap pairs of Avalanche

    Swap pairs of BSC

    Kashi pairs on Avalanche

    Kashi pairs on BSC

    On the next parts, I will put a sample screenshot of how my result table looks like.

    Note: As I used the data from outside of Flipside, I didn’t write queries, but in order to be eligible to submit my dashboard I added one simple query to calculate the number of Kashi pools on Avalanche.

    db_img

    The sample code for tables

    import json, pandas as pd
    
    data = {}
    with open('avax.json', 'r') as f:
       data = json.load(f)
    
    df = pd.DataFrame(columns=['pair-name', 'swap-address', 'token0_symbol','token0_name',
     'token0_contract_address', 'token0_decimals', 'token1_symbol', 
     'token1_name', 'token1_contract_address', 'token1_decimals' ])
    
    for i in range(len(data)):
        df = df.append({ 'pair-name': data[i]['pair']['token0']['symbol'] + '-' + data[i]['pair']['token1']['symbol'],
         'swap-address' : data[i]['pair']['id'],
        'token0_symbol' : data[i]['pair']['token0']['symbol'],
            'token0_name' : data[i]['pair']['token0']['name'],
            'token0_contract_address' : data[i]['pair']['token0']['id'],
            'token0_decimals' : data[i]['pair']['token0']['decimals'],
            'token1_symbol' : data[i]['pair']['token1']['symbol'],
            'token1_name' : data[i]['pair']['token1']['name'],
            'token1_contract_address' : data[i]['pair']['token1']['id'],
            'token1_decimals' : data[i]['pair']['token1']['decimals']}, ignore_index=True)
    
    df.to_csv (r'avax_final.csv', index = None)
    

    So here, I took every JSON files related to the raw data from Sushiswap, and I created a Dataframe in a way that I wanted so I could have the columns I need from it.

    Loading...

    Swap pairs

    In the results of swap pairs for both Avalanche and BSC, we can see these columns:

    pair-nameswap-addresstoken0_symboltoken0_nametoken0_contract_addresstoken0_decimalstoken1_symboltoken1_nametoken1_contract_addresstoken1_decimals

    There is a screenshot of swap pairs on BSC.

    Kashi Pairs

    In the results of Kashi pairs for both Avalanche and BSC, we can see the these columns:

    Pair Addressmain_asset Namemain_asset Symbolmain_asset Contract Addressmain_asset Decimalscollateral Namecollateral Symbolcollateral Contract Addresscollateral Decimals

    So as the question asked, I made the main asset and collateral clear here, also added decimals for each one.

    There is a screenshot of Kashi pairs on Avalanche.

    db_img

    I once again put the results link from my Google sheet account:

    Swap pairs of Avalanche

    Swap pairs of BSC

    Kashi pairs on Avalanche

    Kashi pairs on BSC