@merkl/api 0.20.21 → 0.20.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { PrismaClient as ApiPrismaClient } from "@db/api";
2
2
  import { PrismaClient as EnginePrismaClient } from "@db/engine";
3
3
  import { drizzle } from "drizzle-orm/prisma/pg";
4
4
  export const apiDbClient = new ApiPrismaClient({
5
- datasources: { db: { url: `${process.env.DATABASE_API_URL}&connection_limit=250&pool_timeout=15` } },
5
+ datasources: { db: { url: `${process.env.DATABASE_API_URL}&connection_limit=150&pool_timeout=60` } },
6
6
  }).$extends(drizzle());
7
7
  export const engineDbClient = new EnginePrismaClient({
8
8
  datasources: {
@@ -38,6 +38,9 @@ async function computeEventBasedPoolTVLFromMostRecentStateSave(chainId, campaign
38
38
  const { fileName, bucketName } = states;
39
39
  // Bucket service
40
40
  let tvl = 0;
41
+ if (!fileName || !bucketName) {
42
+ return { tvl, blockNumber: blockNumber };
43
+ }
41
44
  try {
42
45
  const bucket = new BucketService("merkl-production-states", "merkl-production");
43
46
  const storedStates = JSON.parse(await bucket.pull(fileName));
@@ -47,7 +47,7 @@ const main = async () => {
47
47
  status = "SOON";
48
48
  }
49
49
  if (status === "PAST" && opportunity.apr !== 0)
50
- await OpportunityService.update(opportunity.id, { status, apr: 0 });
50
+ await OpportunityService.update(opportunity.id, { status, apr: 0, dailyRewards: 0 });
51
51
  if (opportunity.status !== status)
52
52
  await OpportunityService.updateStatus(opportunity.id, status);
53
53
  }
@@ -667,7 +667,8 @@ export declare abstract class OpportunityRepository {
667
667
  /**
668
668
  * @dev Live campaigns here can be:
669
669
  * 1. Opportunities with status LIVE
670
- * 2. Opportunities with campaigns that have endTimestamp > now
670
+ * 2. Opportunities with non-test campaigns that have endTimestamp > now
671
+ *
671
672
  */
672
673
  static findLiveWithCampaigns(chainId: MerklChainId, take?: number): Promise<({
673
674
  Chain: {
@@ -351,7 +351,8 @@ export class OpportunityRepository {
351
351
  /**
352
352
  * @dev Live campaigns here can be:
353
353
  * 1. Opportunities with status LIVE
354
- * 2. Opportunities with campaigns that have endTimestamp > now
354
+ * 2. Opportunities with non-test campaigns that have endTimestamp > now
355
+ *
355
356
  */
356
357
  static async findLiveWithCampaigns(chainId, take) {
357
358
  const now = moment().unix();
@@ -389,6 +390,7 @@ export class OpportunityRepository {
389
390
  {
390
391
  Campaigns: {
391
392
  some: {
393
+ RewardToken: { isTest: false },
392
394
  startTimestamp: {
393
395
  lte: now,
394
396
  },
@@ -3448,6 +3448,9 @@ const ModeInterfaceCampaigns = {
3448
3448
  "0xe3C3A08AE41c36b204eF9a980f9eF5C579CC3f0f",
3449
3449
  "0xd65EaCAed50706254b5001f22963C8615968AF7d",
3450
3450
  "0xFdC4ba603B25Fbf2659a45cED114a205a4867457",
3451
+ "0xb837EDcf60C1CB6DF49111DF7fd28611b3321345",
3452
+ "0x0A19f7Ab7CF872A354994b82860d991d4451e39b",
3453
+ "0x210aECfbd69894DAF5006bF245F7235354E775C6",
3451
3454
  ],
3452
3455
  url: "https://classic.bmx.trade/deli-shop/wrapper",
3453
3456
  forwarders: [],