Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ArjunWhabi opened this issue Jul 30, 2022 · 0 comments

Comments

@ArjunWhabi
Copy link

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
    }
 
    }
    ''')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant