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

V3 canary #631

Merged
merged 10 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@ 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,
profilesSampleRate: 0.1,
tracesSampleRate: 0.005,
profilesSampleRate: 0.005,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one depends on tracesSampleRate, so now it's 0.005 of 0.005 total traces. we can leave it as 0.1 - 10% of traces.

beforeSend(event, hint) {
const error = hint.originalException as string;
if (error?.toString().includes('Unknown token:')) {
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