Skip to content

Whats the correct Order in GraphQL, as well as mistakes in Liquidity.py? #1

@ArjunWhabi

Description

@ArjunWhabi

Hi

  1. on the Backtest.py,
    This should be removed:
    # Mistake in code
    #amounts= liquidity.get_amounts((dpd['price0'].iloc[i]10*(decimal)),mini,maxi,myliquidity,decimal0,decimal1)
    and changed to :
    amounts= liquidity.get_amounts((dpd['price0'].iloc[i]),mini,maxi,myliquidity,decimal0,decimal1)
    because liquidity.get_amounts function is already applying this transformation insde the function dpd['price0'].iloc[i]10*(decimal). I have tested my result on live data.

  2. The graphQl request fetches data in descending order. In this intentional? I think it should be in ascending order. i.e. Latest time stamp should be towers the end of the "dpd" dataframe. All the profitability in charts.py uses .iloc[0] to select the starting point to calculate returns profits losses etc
    So which is the correct order?


query = gql('''
    query ($fromdate: Int!)
    {
    poolHourDatas(where:{pool:"'''+str(Adress)+'''",periodStartUnix_gt:$fromdate},orderBy:periodStartUnix,orderDirection:desc,first:1000)
    {
    periodStartUnix
    liquidity
    high
    low
    pool{
        
        totalValueLockedUSD
        totalValueLockedToken1
        totalValueLockedToken0
        token0
            {decimals
            }
        token1
            {decimals
            }
        }
    close
    feeGrowthGlobal0X128
    feeGrowthGlobal1X128
    }
 
    }
    ''')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy