Skip to content

Commit

Permalink
Merge pull request #31 from balancer/v3-canary
Browse files Browse the repository at this point in the history
V3 canary
  • Loading branch information
franzns authored Jan 11, 2024
2 parents 339fc55 + f0dcc20 commit 6b7ae90
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 23 deletions.
3 changes: 2 additions & 1 deletion modules/content/sanity-content.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})),
);
}
Expand Down
32 changes: 18 additions & 14 deletions modules/network/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,73 +173,77 @@ 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',
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: '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
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,6 @@ export class GaugeAprService implements PoolAprService {
}
}

await prismaBulkExecuteOperations(operations, true);
await prismaBulkExecuteOperations(operations);
}
}
2 changes: 1 addition & 1 deletion modules/pool/lib/pool-snapshot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class PoolSnapshotService {
operations.push(...poolOperations);
}

await prismaBulkExecuteOperations(operations, true);
await prismaBulkExecuteOperations(operations);

const poolsWithoutSnapshots = await prisma.prismaPool.findMany({
where: {
Expand Down
2 changes: 1 addition & 1 deletion modules/token/lib/token-price.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class TokenPriceService {
}

public async purgeOldTokenPricesForAllChains(): Promise<number> {
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 },
Expand Down
12 changes: 9 additions & 3 deletions modules/user/lib/user-snapshot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class UserSnapshotService {
}),
);
}
await prismaBulkExecuteOperations(operations, true);
await prismaBulkExecuteOperations(operations);
}

public async syncUserPoolBalanceSnapshots() {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions modules/user/lib/user-sync-gauge-balance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -228,7 +228,7 @@ export class UserSyncGaugeBalanceService implements UserStakedBalanceService {
chain: this.chain,
},
},
data: { blockNumber: endBlock },
data: { blockNumber: toBlock },
}),
],
true,
Expand Down

0 comments on commit 6b7ae90

Please sign in to comment.