-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Hi
-
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. -
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
}
}
''')