diff --git a/modules/content/sanity-content.service.ts b/modules/content/sanity-content.service.ts index 9da7f2112..1ed63c6c7 100644 --- a/modules/content/sanity-content.service.ts +++ b/modules/content/sanity-content.service.ts @@ -277,9 +277,10 @@ export class SanityContentService implements ContentService { `); if (data) { featuredPoolGroups.push( - ...data.featuredPoolGroups.map((pool) => ({ + ...data.featuredPoolGroups.map((pool, i) => ({ ...pool, chain: chain, + primary: i === 0 ? true : false, })), ); } diff --git a/modules/network/base.ts b/modules/network/base.ts index f57e9420c..43344f5b5 100644 --- a/modules/network/base.ts +++ b/modules/network/base.ts @@ -173,27 +173,27 @@ export const baseNetworkConfig: 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', @@ -201,7 +201,7 @@ export const baseNetworkConfig: NetworkConfig = { }, { 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', @@ -209,21 +209,25 @@ export const baseNetworkConfig: NetworkConfig = { }, { 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', @@ -231,15 +235,15 @@ export const baseNetworkConfig: NetworkConfig = { }, { 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', diff --git a/modules/pool/lib/apr-data-sources/ve-bal-gauge-apr.service.ts b/modules/pool/lib/apr-data-sources/ve-bal-gauge-apr.service.ts index 17906c4af..d264ef6ab 100644 --- a/modules/pool/lib/apr-data-sources/ve-bal-gauge-apr.service.ts +++ b/modules/pool/lib/apr-data-sources/ve-bal-gauge-apr.service.ts @@ -169,6 +169,6 @@ export class GaugeAprService implements PoolAprService { } } - await prismaBulkExecuteOperations(operations, true); + await prismaBulkExecuteOperations(operations); } } diff --git a/modules/pool/lib/pool-snapshot.service.ts b/modules/pool/lib/pool-snapshot.service.ts index 9ccf126e6..f46e8c757 100644 --- a/modules/pool/lib/pool-snapshot.service.ts +++ b/modules/pool/lib/pool-snapshot.service.ts @@ -107,7 +107,7 @@ export class PoolSnapshotService { operations.push(...poolOperations); } - await prismaBulkExecuteOperations(operations, true); + await prismaBulkExecuteOperations(operations); const poolsWithoutSnapshots = await prisma.prismaPool.findMany({ where: { diff --git a/modules/token/lib/token-price.service.ts b/modules/token/lib/token-price.service.ts index 792132e72..9b51277fb 100644 --- a/modules/token/lib/token-price.service.ts +++ b/modules/token/lib/token-price.service.ts @@ -256,7 +256,7 @@ export class TokenPriceService { } public async purgeOldTokenPricesForAllChains(): Promise { - const purgeBeforeTimestamp = moment().startOf('day').subtract(180, 'days').utc().unix(); + const purgeBeforeTimestamp = moment().startOf('day').subtract(100, 'days').utc().unix(); const oldPrices = await prisma.prismaTokenPrice.findMany({ where: { timestamp: { lt: purgeBeforeTimestamp }, diff --git a/modules/user/lib/user-snapshot.service.ts b/modules/user/lib/user-snapshot.service.ts index b13eeac55..dfc1a3e93 100644 --- a/modules/user/lib/user-snapshot.service.ts +++ b/modules/user/lib/user-snapshot.service.ts @@ -172,7 +172,7 @@ export class UserSnapshotService { }), ); } - await prismaBulkExecuteOperations(operations, true); + await prismaBulkExecuteOperations(operations); } public async syncUserPoolBalanceSnapshots() { @@ -269,7 +269,10 @@ export class UserSnapshotService { operations.push( prisma.prismaUserPoolBalanceSnapshot.upsert({ where: { - id_chain: { id: userPoolBalanceSnapshotData.id, chain: userPoolBalanceSnapshotData.chain }, + id_chain: { + id: userPoolBalanceSnapshotData.id, + chain: userPoolBalanceSnapshotData.chain, + }, }, create: userPoolBalanceSnapshotData, update: userPoolBalanceSnapshotData, @@ -299,7 +302,10 @@ export class UserSnapshotService { operations.push( prisma.prismaUserPoolBalanceSnapshot.upsert({ where: { - id_chain: { id: userPoolBalanceSnapshotData.id, chain: userPoolBalanceSnapshotData.chain }, + id_chain: { + id: userPoolBalanceSnapshotData.id, + chain: userPoolBalanceSnapshotData.chain, + }, }, create: userPoolBalanceSnapshotData, update: userPoolBalanceSnapshotData, diff --git a/modules/user/lib/user-sync-gauge-balance.service.ts b/modules/user/lib/user-sync-gauge-balance.service.ts index fcf8eb2a5..b48274dbc 100644 --- a/modules/user/lib/user-sync-gauge-balance.service.ts +++ b/modules/user/lib/user-sync-gauge-balance.service.ts @@ -171,7 +171,7 @@ export class UserSyncGaugeBalanceService implements UserStakedBalanceService { if (balancesToFetch.length === 0) { await prisma.prismaUserBalanceSyncStatus.update({ where: { type_chain: { type: 'STAKED', chain: this.chain } }, - data: { blockNumber: endBlock }, + data: { blockNumber: toBlock }, }); return; @@ -228,7 +228,7 @@ export class UserSyncGaugeBalanceService implements UserStakedBalanceService { chain: this.chain, }, }, - data: { blockNumber: endBlock }, + data: { blockNumber: toBlock }, }), ], true,