Skip to content

Commit

Permalink
Merge pull request #631 from beethovenxfi/v3-canary
Browse files Browse the repository at this point in the history
V3 canary
  • Loading branch information
franzns authored Jan 9, 2024
2 parents 2020784 + d77499c commit 339fc55
Show file tree
Hide file tree
Showing 20 changed files with 177 additions and 248 deletions.
10 changes: 5 additions & 5 deletions app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ import { ProfilingIntegration } from '@sentry/profiling-node';
import { sentryPlugin } from './app/gql/sentry-apollo-plugin';
import { startWorker } from './worker/worker';
import { startScheduler } from './worker/scheduler';
import { prisma } from './prisma/prisma-client';

async function startServer() {
const app = createExpressApp();

Sentry.init({
dsn: env.SENTRY_DSN,
// tracesSampleRate: 0.005,
environment: `multichain-${env.DEPLOYMENT_ENV}`,
enabled: env.NODE_ENV === 'production',
ignoreErrors: [/.*error: Provide.*chain.*param/],
integrations: [
// new Tracing.Integrations.Apollo(),
// new Tracing.Integrations.GraphQL(),
// new Tracing.Integrations.Prisma({ client: prisma }),
new Sentry.Integrations.Apollo(),
new Sentry.Integrations.GraphQL(),
new Sentry.Integrations.Prisma({ client: prisma }),
new Sentry.Integrations.Express({ app }),
new Sentry.Integrations.Http({ tracing: true }),
new ProfilingIntegration(),
],
tracesSampleRate: 0.2,
tracesSampleRate: 0.005,
profilesSampleRate: 0.1,
beforeSend(event, hint) {
const error = hint.originalException as string;
Expand Down
41 changes: 18 additions & 23 deletions modules/network/arbitrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ const arbitrumNetworkData: NetworkData = {
platformId: 'arbitrum-one',
excludedTokenAddresses: ['0x6dbf2155b0636cb3fd5359fccefb8a2c02b6cb51'], // plsRDNT, has coingecko entry but no price
},
tokenPrices: {
maxHourlyPriceHistoryNumDays: 100,
},
rpcUrl:
env.INFURA_API_KEY && (env.DEPLOYMENT_ENV as DeploymentEnv) === 'main'
? `https://arbitrum-mainnet.infura.io/v3/${env.INFURA_API_KEY}`
Expand Down Expand Up @@ -266,79 +263,77 @@ export const arbitrumNetworkConfig: NetworkConfig = {
},
{
name: 'update-liquidity-for-active-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(8, 'minutes') : every(4, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(6, 'minutes') : every(2, 'minutes'),
},
{
name: 'update-pool-apr',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(7, 'minutes') : every(5, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(6, 'minutes') : every(2, 'minutes'),
},
{
name: 'load-on-chain-data-for-pools-with-active-updates',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(9, 'minutes') : every(5, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(4, 'minutes') : every(1, 'minutes'),
},
{
name: 'sync-new-pools-from-subgraph',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(12, 'minutes') : every(8, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(6, 'minutes') : every(2, 'minutes'),
},
{
name: 'sync-tokens-from-pool-tokens',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(7, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(5, 'minutes'),
},
{
name: 'update-liquidity-24h-ago-for-all-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(15, 'minutes') : every(8, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(5, 'minutes'),
},
{
name: 'cache-average-block-time',
interval: every(1, 'hours'),
},
{
name: 'sync-staking-for-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(15, 'minutes') : every(10, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(5, 'minutes'),
},
{
name: 'sync-latest-snapshots-for-all-pools',
interval: every(90, 'minutes'),
},
{
name: 'update-lifetime-values-for-all-pools',
interval: every(45, 'minutes'),
interval: every(50, 'minutes'),
},
{
name: 'sync-changed-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(2, 'minutes') : every(1, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(2, 'minutes') : every(30, 'seconds'),
alarmEvaluationPeriod: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
alarmDatapointsToAlarm: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
},
{
name: 'user-sync-wallet-balances-for-all-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(29, 'minutes') : every(9, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(5, 'minutes') : every(20, 'seconds'),
alarmEvaluationPeriod: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
alarmDatapointsToAlarm: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
},
{
name: 'user-sync-staked-balances',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(31, 'minutes') : every(11, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(5, 'minutes') : every(20, 'seconds'),
alarmEvaluationPeriod: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
alarmDatapointsToAlarm: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
},
{
name: 'sync-coingecko-coinids',
interval: every(2, 'hours'),
},
{
name: 'purge-old-tokenprices',
interval: every(1, 'days'),
alarmEvaluationPeriod: 1,
alarmDatapointsToAlarm: 1,
},
{
name: 'update-fee-volume-yield-all-pools',
interval: every(75, 'minutes'),
interval: every(1, 'hours'),
},
{
name: 'sync-vebal-balances',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(20, 'minutes') : every(14, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(9, 'minutes') : every(3, 'minutes'),
},
{
name: 'sync-vebal-totalSupply',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(20, 'minutes') : every(16, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(5, 'minutes'),
},
{
name: 'feed-data-to-datastudio',
Expand Down
41 changes: 18 additions & 23 deletions modules/network/avalanche.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ const avalancheNetworkData: NetworkData = {
platformId: 'avalanche',
excludedTokenAddresses: [],
},
tokenPrices: {
maxHourlyPriceHistoryNumDays: 100,
},
rpcUrl:
env.INFURA_API_KEY && (env.DEPLOYMENT_ENV as DeploymentEnv) === 'main'
? `https://avalanche-mainnet.infura.io/v3/${env.INFURA_API_KEY}`
Expand Down Expand Up @@ -260,79 +257,77 @@ export const avalancheNetworkConfig: NetworkConfig = {
},
{
name: 'update-liquidity-for-active-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(8, 'minutes') : every(4, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(6, 'minutes') : every(2, 'minutes'),
},
{
name: 'update-pool-apr',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(7, 'minutes') : every(5, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(6, 'minutes') : every(2, 'minutes'),
},
{
name: 'load-on-chain-data-for-pools-with-active-updates',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(9, 'minutes') : every(5, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(4, 'minutes') : every(1, 'minutes'),
},
{
name: 'sync-new-pools-from-subgraph',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(12, 'minutes') : every(8, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(6, 'minutes') : every(2, 'minutes'),
},
{
name: 'sync-tokens-from-pool-tokens',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(7, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(5, 'minutes'),
},
{
name: 'update-liquidity-24h-ago-for-all-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(15, 'minutes') : every(8, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(5, 'minutes'),
},
{
name: 'cache-average-block-time',
interval: every(1, 'hours'),
},
{
name: 'sync-staking-for-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(15, 'minutes') : every(10, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(5, 'minutes'),
},
{
name: 'sync-latest-snapshots-for-all-pools',
interval: every(90, 'minutes'),
},
{
name: 'update-lifetime-values-for-all-pools',
interval: every(45, 'minutes'),
interval: every(50, 'minutes'),
},
{
name: 'sync-changed-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(2, 'minutes') : every(1, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(2, 'minutes') : every(30, 'seconds'),
alarmEvaluationPeriod: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
alarmDatapointsToAlarm: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
},
{
name: 'user-sync-wallet-balances-for-all-pools',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(29, 'minutes') : every(9, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(5, 'minutes') : every(20, 'seconds'),
alarmEvaluationPeriod: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
alarmDatapointsToAlarm: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
},
{
name: 'user-sync-staked-balances',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(31, 'minutes') : every(11, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(5, 'minutes') : every(20, 'seconds'),
alarmEvaluationPeriod: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
alarmDatapointsToAlarm: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? 3 : 1,
},
{
name: 'sync-coingecko-coinids',
interval: every(2, 'hours'),
},
{
name: 'purge-old-tokenprices',
interval: every(1, 'days'),
alarmEvaluationPeriod: 1,
alarmDatapointsToAlarm: 1,
},
{
name: 'update-fee-volume-yield-all-pools',
interval: every(75, 'minutes'),
interval: every(1, 'hours'),
},
{
name: 'sync-vebal-balances',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(20, 'minutes') : every(14, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(9, 'minutes') : every(3, 'minutes'),
},
{
name: 'sync-vebal-totalSupply',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(20, 'minutes') : every(16, 'minutes'),
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(5, 'minutes'),
},
{
name: 'feed-data-to-datastudio',
Expand Down
9 changes: 0 additions & 9 deletions modules/network/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ const baseNetworkData: NetworkData = {
platformId: 'base',
excludedTokenAddresses: [],
},
tokenPrices: {
maxHourlyPriceHistoryNumDays: 100,
},
rpcUrl: 'https://base.gateway.tenderly.co/7mM7DbBouY1JjnQd9MMDsd',
rpcMaxBlockRange: 500,
protocolToken: 'bal',
Expand Down Expand Up @@ -232,12 +229,6 @@ export const baseNetworkConfig: NetworkConfig = {
name: 'sync-coingecko-coinids',
interval: every(2, 'hours'),
},
{
name: 'purge-old-tokenprices',
interval: every(1, 'days'),
alarmEvaluationPeriod: 1,
alarmDatapointsToAlarm: 1,
},
{
name: 'update-fee-volume-yield-all-pools',
interval: every(75, 'minutes'),
Expand Down
9 changes: 0 additions & 9 deletions modules/network/fantom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ const fantomNetworkData: NetworkData = {
'0xb7c2ddb1ebac1056231ef22c1b0a13988537a274', // new tarot
],
},
tokenPrices: {
maxHourlyPriceHistoryNumDays: 100,
},
rpcUrl:
(env.DEPLOYMENT_ENV as DeploymentEnv) === 'main'
? `https://rpc.ankr.com/fantom`
Expand Down Expand Up @@ -438,12 +435,6 @@ export const fantomNetworkConfig: NetworkConfig = {
name: 'sync-latest-relic-snapshots',
interval: every(1, 'hours'),
},
{
name: 'purge-old-tokenprices',
interval: every(1, 'days'),
alarmEvaluationPeriod: 1,
alarmDatapointsToAlarm: 1,
},
{
name: 'sync-coingecko-coinids',
interval: every(2, 'hours'),
Expand Down
9 changes: 0 additions & 9 deletions modules/network/gnosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ const gnosisNetworkData: NetworkData = {
platformId: 'xdai',
excludedTokenAddresses: [],
},
tokenPrices: {
maxHourlyPriceHistoryNumDays: 100,
},
rpcUrl:
(env.DEPLOYMENT_ENV as DeploymentEnv) === 'main' ? `https://rpc.gnosischain.com` : 'https://gnosis.drpc.org',
rpcMaxBlockRange: 2000,
Expand Down Expand Up @@ -240,12 +237,6 @@ export const gnosisNetworkConfig: NetworkConfig = {
name: 'sync-coingecko-coinids',
interval: every(2, 'hours'),
},
{
name: 'purge-old-tokenprices',
interval: every(1, 'days'),
alarmEvaluationPeriod: 1,
alarmDatapointsToAlarm: 1,
},
{
name: 'update-fee-volume-yield-all-pools',
interval: every(75, 'minutes'),
Expand Down
27 changes: 12 additions & 15 deletions modules/network/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,10 @@ const data: NetworkData = {
'0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee', // weEth, has coingekco entry but no price
],
},
tokenPrices: {
maxHourlyPriceHistoryNumDays: 100,
},
rpcUrl:
env.INFURA_API_KEY && (env.DEPLOYMENT_ENV as DeploymentEnv) === 'main'
? `https://mainnet.infura.io/v3/${env.INFURA_API_KEY}`
: 'https://eth.llamarpc.com',
: 'https://rpc.eth.gateway.fm',
rpcMaxBlockRange: 700,
protocolToken: 'bal',
bal: {
Expand Down Expand Up @@ -468,12 +465,6 @@ export const mainnetNetworkConfig: NetworkConfig = {
name: 'sync-coingecko-coinids',
interval: every(2, 'hours'),
},
{
name: 'purge-old-tokenprices',
interval: every(1, 'days'),
alarmEvaluationPeriod: 1,
alarmDatapointsToAlarm: 1,
},
{
name: 'update-fee-volume-yield-all-pools',
interval: every(75, 'minutes'),
Expand All @@ -490,11 +481,6 @@ export const mainnetNetworkConfig: NetworkConfig = {
name: 'sync-vebal-voting-gauges',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(20, 'minutes') : every(5, 'minutes'),
},
// The following are multichain jobs and should only run once for all chains.
{
name: 'sync-global-coingecko-prices',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(2, 'minutes'),
},
{
name: 'feed-data-to-datastudio',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(5, 'minutes') : every(5, 'minutes'),
Expand All @@ -503,5 +489,16 @@ export const mainnetNetworkConfig: NetworkConfig = {
name: 'sync-latest-fx-prices',
interval: every(10, 'minutes'),
},
// The following are multichain jobs and should only run once for all chains.
{
name: 'sync-global-coingecko-prices',
interval: (env.DEPLOYMENT_ENV as DeploymentEnv) === 'canary' ? every(10, 'minutes') : every(2, 'minutes'),
},
{
name: 'global-purge-old-tokenprices',
interval: every(1, 'days'),
alarmEvaluationPeriod: 1,
alarmDatapointsToAlarm: 1,
},
],
};
3 changes: 0 additions & 3 deletions modules/network/network-config-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ export interface NetworkData {
platformId: string;
excludedTokenAddresses: string[];
};
tokenPrices: {
maxHourlyPriceHistoryNumDays: number;
};
subgraphs: {
startDate: string;
balancer: string;
Expand Down
Loading

0 comments on commit 339fc55

Please sign in to comment.