diff --git a/app/env.ts b/app/env.ts index 7860eccea..843b1d4f6 100644 --- a/app/env.ts +++ b/app/env.ts @@ -17,10 +17,18 @@ export const schema = { optional: true, type: String, }, + GROVE_CITY: { + optional: true, + type: String, + }, INFURA_API_KEY: { optional: true, type: String, }, + GATEWAYFM_API_KEY: { + optional: true, + type: String, + }, ALCHEMY_API_KEY: { optional: true, type: String, diff --git a/env.local b/env.local index 2fb1bba94..bf4e9fc42 100644 --- a/env.local +++ b/env.local @@ -2,6 +2,10 @@ PORT=4000 NODE_ENV=local DEPLOYMENT_ENV=canary +# RPCs +GROVE_CITY= +INFURA_API_KEY= + # Database DATABASE_URL=postgresql://backend:let-me-in@localhost:5431/database?schema=public @@ -36,8 +40,6 @@ SENTRY_AUTH_TOKEN= APOLLO_GRAPH_REF= APOLLO_API_KEY= -INFURA_API_KEY= - # Admin routes ADMIN_API_KEY= diff --git a/modules/network/avalanche.ts b/modules/network/avalanche.ts index 036562204..4f3c9113a 100644 --- a/modules/network/avalanche.ts +++ b/modules/network/avalanche.ts @@ -163,13 +163,13 @@ const avalancheNetworkData: NetworkData = { }, ggAVAX: { tokenAddress: '0xa25eaf2906fa1a3a13edac9b9657108af7b703e3', - sourceUrl: 'https://ceres.gogopool.com', - path: 'ggAVAXMonthlyInterestMonth.value', + sourceUrl: 'https://api.gogopool.com/metrics', + path: 'ggavax_apy', + // Updated from https://ceres.gogopool.com/ which used below calculation and scale -8.3333 // According to solarcurve, the AVAX Monthly Interest must be multiplied by -12 to represent the APR in normal scale, for example, if the monthly interest is -0,15, the APR would be -0,15 * -12 = 1,8%. // @solarcurve: We estimate by multiplying that value by -12 since its the exchange rate of AVAX -> ggAVAX, which will always return less ggAVAX than AVAX // How this -12 became -8,333? It's because the scale parameter is used to divide the number, and the final apr percentage is in decimal format (1,8% = 0,018), so if: // M * -12 = A (M is monthly rate and A is APR) => (M/x) = (A/100) => (A / -12x) = (A / 100) [replacing M by A/-12] => x = 100/-12 = -8,33333 - scale: -8.3333, }, ankrAVAX: { tokenAddress: '0xc3344870d52688874b06d844e0c36cc39fc727f6', diff --git a/modules/network/gnosis.ts b/modules/network/gnosis.ts index 8df1f6612..e8532f9c8 100644 --- a/modules/network/gnosis.ts +++ b/modules/network/gnosis.ts @@ -53,8 +53,8 @@ const gnosisNetworkData: NetworkData = { excludedTokenAddresses: [], }, rpcUrl: - (env.DEPLOYMENT_ENV as DeploymentEnv) === 'main' - ? `https://rpc.eu-central-2.gateway.fm/v4/gnosis/non-archival/mainnet` + env.GATEWAYFM_API_KEY && (env.DEPLOYMENT_ENV as DeploymentEnv) === 'main' + ? `https://rpc.eu-central-2.gateway.fm/v4/gnosis/archival/mainnet?apiKey=${env.GATEWAYFM_API_KEY}` : 'https://gnosis.drpc.org', rpcMaxBlockRange: 2000, protocolToken: 'bal', diff --git a/modules/network/zkevm.ts b/modules/network/zkevm.ts index e1202ba1d..65fc4c126 100644 --- a/modules/network/zkevm.ts +++ b/modules/network/zkevm.ts @@ -53,7 +53,9 @@ const zkevmNetworkData: NetworkData = { excludedTokenAddresses: [], }, rpcUrl: - env.ALCHEMY_API_KEY && (env.DEPLOYMENT_ENV as DeploymentEnv) === 'main' + env.GROVE_CITY + ? `https://polygon-zkevm-mainnet.rpc.grove.city/v1/${env.GROVE_CITY}` + : env.ALCHEMY_API_KEY && (env.DEPLOYMENT_ENV as DeploymentEnv) === 'main' ? `https://polygonzkevm-mainnet.g.alchemy.com/v2/${env.ALCHEMY_API_KEY}` : 'https://zkevm-rpc.com', rpcMaxBlockRange: 2000, @@ -198,10 +200,10 @@ export const zkevmNetworkConfig: NetworkConfig = { ), }, /* - For sub-minute jobs we set the alarmEvaluationPeriod and alarmDatapointsToAlarm to 1 instead of the default 3. + For sub-minute jobs we set the alarmEvaluationPeriod and alarmDatapointsToAlarm to 1 instead of the default 3. This is needed because the minimum alarm period is 1 minute and we want the alarm to trigger already after 1 minute instead of 3. - For every 1 days jobs we set the alarmEvaluationPeriod and alarmDatapointsToAlarm to 1 instead of the default 3. + For every 1 days jobs we set the alarmEvaluationPeriod and alarmDatapointsToAlarm to 1 instead of the default 3. This is needed because the maximum alarm evaluation period is 1 day (period * evaluationPeriod). */ workerJobs: [