@merkl/api 0.20.62 → 0.20.64

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.
Files changed (28) hide show
  1. package/dist/database/index.js +1 -1
  2. package/dist/src/eden/index.d.ts +0 -154
  3. package/dist/src/engine/dynamicData/factory.js +3 -2
  4. package/dist/src/engine/dynamicData/implementations/CompoundV3.d.ts +7 -0
  5. package/dist/src/engine/dynamicData/implementations/CompoundV3.js +69 -0
  6. package/dist/src/engine/opportunityMetadata/factory.js +3 -2
  7. package/dist/src/engine/opportunityMetadata/implementations/CompoundV3.d.ts +17 -0
  8. package/dist/src/engine/opportunityMetadata/implementations/CompoundV3.js +19 -0
  9. package/dist/src/index.d.ts +0 -38
  10. package/dist/src/jobs/update-analytics.d.ts +1 -0
  11. package/dist/src/jobs/update-analytics.js +21 -0
  12. package/dist/src/jobs/update-dynamic-data.js +10 -12
  13. package/dist/src/jobs/update-rpc-calls-cache.js +2 -1
  14. package/dist/src/modules/v4/campaign/campaign.controller.js +5 -3
  15. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +0 -38
  16. package/dist/src/modules/v4/opportunity/opportunity.controller.js +2 -9
  17. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +0 -11
  18. package/dist/src/modules/v4/opportunity/opportunity.model.js +0 -5
  19. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +2 -2
  20. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +2 -2
  21. package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +12 -2
  22. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +12 -1
  23. package/dist/src/modules/v4/programPayload/programPayload.repository.js +24 -13
  24. package/dist/src/modules/v4/reward/reward.controller.js +5 -3
  25. package/dist/src/modules/v4/router.d.ts +0 -38
  26. package/dist/src/modules/v4/token/token.service.js +1 -2
  27. package/dist/tsconfig.package.tsbuildinfo +1 -1
  28. package/package.json +2 -1
@@ -1,7 +1,7 @@
1
1
  import { type CreateCampaignModel, type GetCampaignQueryModel } from "@/modules/v4/campaign";
2
2
  import { type OpportunityManualOverride, type Prisma } from "@db/api";
3
3
  import { type MerklChainId } from "@sdk";
4
- import type { CreateOpportunityModel, GetOpportunitiesQueryModel, LightOpportunityFromDB, Opportunity, OpportunityOverrideModel, OpportunityResourceModel, OpportunityUnique, UpdateOpportunityModel } from "./opportunity.model";
4
+ import type { CreateOpportunityModel, GetOpportunitiesQueryModel, LightOpportunityFromDB, Opportunity, OpportunityOverrideModel, OpportunityResourceModel, OpportunityUnique } from "./opportunity.model";
5
5
  import { OpportunityRepository } from "./opportunity.repository";
6
6
  export declare abstract class OpportunityService {
7
7
  #private;
@@ -988,5 +988,5 @@ export declare abstract class OpportunityService {
988
988
  apr: number;
989
989
  dailyRewards: number;
990
990
  }>;
991
- static updateMany(ids: string[], data: UpdateOpportunityModel): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
991
+ static updateMany(ids: string[], data: Partial<Opportunity["raw"]>): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
992
992
  }
@@ -1,4 +1,4 @@
1
- import type { Campaign, CompFork, CompoundSubCampaignType, Forwarder, ForwarderParameters, HOOK, HookParameters, MerklChainId, MorphoSubCampaignType } from "@sdk";
1
+ import type { Campaign, CompFork, CompoundSubCampaignType, CompoundV3SubCampaignType, Forwarder, ForwarderParameters, HOOK, HookParameters, MerklChainId, MorphoSubCampaignType } from "@sdk";
2
2
  export declare const CampaignPayloadInputDto: import("@sinclair/typebox").TObject<{
3
3
  campaign: import("@sinclair/typebox").TString;
4
4
  program: import("@sinclair/typebox").TString;
@@ -154,6 +154,16 @@ export type partialConfigERC20 = {
154
154
  forwarders: ForwarderParameters<Forwarder>[];
155
155
  apr?: number;
156
156
  };
157
+ export type partialConfigCompoundV3 = {
158
+ computeChainId?: MerklChainId;
159
+ hooks?: (HookParameters<HOOK> | string)[];
160
+ campaignType: Campaign;
161
+ targetToken: string;
162
+ whitelist: string[];
163
+ blacklist: string[];
164
+ url?: string;
165
+ subCampaignType: CompoundV3SubCampaignType;
166
+ };
157
167
  export type partialConfigMorpho = {
158
168
  computeChainId?: MerklChainId;
159
169
  hooks?: (HookParameters<HOOK> | string)[];
@@ -200,7 +210,7 @@ export type partialConfigAirdrop = {
200
210
  hooks?: (HookParameters<HOOK> | string)[];
201
211
  campaignType: Campaign;
202
212
  };
203
- export type partialConfig = partialConfigERC20 | partialConfigMorpho | partialConfigCLAMM | partialConfigIonic | partialConfigAirdrop;
213
+ export type partialConfig = partialConfigERC20 | partialConfigMorpho | partialConfigCLAMM | partialConfigIonic | partialConfigCompoundV3 | partialConfigAirdrop;
204
214
  export declare const safeTemplate: {
205
215
  version: string;
206
216
  chainId: string;
@@ -18,7 +18,8 @@ export declare enum roninCampaigns {
18
18
  Katana_WETH_RON_Ronin = "Katana WETH-RON Ronin 0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
19
19
  Katana_AXS_RON_Ronin = "Katana AXS-RON Ronin 0x3230b903e8a5d6e46b5a5028470dd33e7b673722",
20
20
  Katana_USDC_RON_Ronin = "Katana USDC-RON Ronin 0x392d372f2a51610e9ac5b741379d5631ca9a1c7f",
21
- Katana_LRON_RON_Ronin = "Katana LRON-RON Ronin 0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8"
21
+ Katana_LRON_RON_Ronin = "Katana LRON-RON Ronin 0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8",
22
+ Supply_WETH_Compound_Ronin = "Supply WETH Compound Ronin 0x4006ed4097ee51c09a04c3b0951d28ccf19e6dfe"
22
23
  }
23
24
  export declare enum anglesCampaigns {
24
25
  Angles_supply_in_angles_liquid = "0x15E96CDecA34B9DE1B31586c1206206aDb92E69D",
@@ -476,6 +477,16 @@ declare const RoninInterfaceCampaigns: {
476
477
  weightToken0: number;
477
478
  weightToken1: number;
478
479
  };
480
+ "Supply WETH Compound Ronin 0x4006ed4097ee51c09a04c3b0951d28ccf19e6dfe": {
481
+ campaignType: any;
482
+ computeChainId: any;
483
+ hooks: never[];
484
+ targetToken: string;
485
+ whitelist: never[];
486
+ blacklist: never[];
487
+ url: string;
488
+ subCampaignType: any;
489
+ };
479
490
  };
480
491
  export declare enum tacCampaigns {
481
492
  TAC_Supply_TACETH = "TAC Supply tacETH 0x294eecec65A0142e84AEdfD8eB2FBEA8c9a9fbad",
@@ -1,4 +1,4 @@
1
- import { BalanceCallType, Campaign, ChainId, CompFork, CompoundSubCampaignType, ComputeScoreMethod, Forwarder, HOOK, MorphoSubCampaignType, StandardType, boostingFunction, boostingReferralFunction, contractStateBoost, defaultBoost, defaultReferralBoost, selectionRaffleMethod, } from "@sdk";
1
+ import { BalanceCallType, Campaign, ChainId, CompFork, CompoundSubCampaignType, CompoundV3SubCampaignType, ComputeScoreMethod, Forwarder, HOOK, MorphoSubCampaignType, StandardType, boostingFunction, boostingReferralFunction, contractStateBoost, defaultBoost, defaultReferralBoost, selectionRaffleMethod, } from "@sdk";
2
2
  import { id } from "ethers/lib/utils";
3
3
  export var program;
4
4
  (function (program) {
@@ -22,6 +22,7 @@ export var roninCampaigns;
22
22
  roninCampaigns["Katana_AXS_RON_Ronin"] = "Katana AXS-RON Ronin 0x3230b903e8a5d6e46b5a5028470dd33e7b673722";
23
23
  roninCampaigns["Katana_USDC_RON_Ronin"] = "Katana USDC-RON Ronin 0x392d372f2a51610e9ac5b741379d5631ca9a1c7f";
24
24
  roninCampaigns["Katana_LRON_RON_Ronin"] = "Katana LRON-RON Ronin 0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8";
25
+ roninCampaigns["Supply_WETH_Compound_Ronin"] = "Supply WETH Compound Ronin 0x4006ed4097ee51c09a04c3b0951d28ccf19e6dfe";
25
26
  })(roninCampaigns || (roninCampaigns = {}));
26
27
  export var anglesCampaigns;
27
28
  (function (anglesCampaigns) {
@@ -502,9 +503,9 @@ const RoninInterfaceCampaigns = {
502
503
  url: "https://app.roninchain.com/liquidity/v3/0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
503
504
  forwarders: [],
504
505
  isOutOfRangeIncentivized: false,
505
- weightFees: 2000,
506
- weightToken0: 4000,
507
- weightToken1: 4000,
506
+ weightFees: 1500,
507
+ weightToken0: 1500,
508
+ weightToken1: 7000,
508
509
  },
509
510
  [roninCampaigns.Katana_AXS_RON_Ronin]: {
510
511
  campaignType: Campaign.CLAMM,
@@ -516,9 +517,9 @@ const RoninInterfaceCampaigns = {
516
517
  url: "https://app.roninchain.com/liquidity/v3/0x3230b903e8a5d6e46b5a5028470dd33e7b673722",
517
518
  forwarders: [],
518
519
  isOutOfRangeIncentivized: false,
519
- weightFees: 2000,
520
- weightToken0: 4000,
521
- weightToken1: 4000,
520
+ weightFees: 1000,
521
+ weightToken0: 3500,
522
+ weightToken1: 5500,
522
523
  },
523
524
  [roninCampaigns.Katana_USDC_RON_Ronin]: {
524
525
  campaignType: Campaign.CLAMM,
@@ -530,9 +531,9 @@ const RoninInterfaceCampaigns = {
530
531
  url: "https://app.roninchain.com/liquidity/v3/0x392d372f2a51610e9ac5b741379d5631ca9a1c7f",
531
532
  forwarders: [],
532
533
  isOutOfRangeIncentivized: false,
533
- weightFees: 2000,
534
- weightToken0: 4000,
535
- weightToken1: 4000,
534
+ weightFees: 1000,
535
+ weightToken0: 2500,
536
+ weightToken1: 6500,
536
537
  },
537
538
  [roninCampaigns.Katana_LRON_RON_Ronin]: {
538
539
  campaignType: Campaign.CLAMM,
@@ -544,9 +545,19 @@ const RoninInterfaceCampaigns = {
544
545
  url: "https://app.roninchain.com/liquidity/v3/0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8",
545
546
  forwarders: [],
546
547
  isOutOfRangeIncentivized: false,
547
- weightFees: 2000,
548
- weightToken0: 4000,
549
- weightToken1: 4000,
548
+ weightFees: 1000,
549
+ weightToken0: 4500,
550
+ weightToken1: 4500,
551
+ },
552
+ [roninCampaigns.Supply_WETH_Compound_Ronin]: {
553
+ campaignType: Campaign.COMPOUND_V3,
554
+ computeChainId: ChainId.RONIN,
555
+ hooks: [],
556
+ targetToken: "0x4006eD4097Ee51c09A04c3B0951D28CCf19e6DFE",
557
+ whitelist: [],
558
+ blacklist: [],
559
+ url: "",
560
+ subCampaignType: CompoundV3SubCampaignType.SUPPLY,
550
561
  },
551
562
  };
552
563
  export var tacCampaigns;
@@ -6,6 +6,8 @@ import { TokenService } from "@/modules/v4/token/token.service";
6
6
  import bigintToString from "@/utils/bigintToString";
7
7
  import { throwOnInvalidRequiredAddress, throwOnUnsupportedChainId } from "@/utils/throw";
8
8
  import Elysia, { t } from "elysia";
9
+ import { CacheService } from "../cache";
10
+ import { TTLPresets } from "../cache/cache.model";
9
11
  import { CampaignIdDto, CampaignIdWithoutPageDto, CampaignRewardsDto, CreateManyBreakdownDto, CreateManyRewardDto, RegisterClaimsDto, TokenIdDto, } from "./reward.model";
10
12
  import { RewardService } from "./reward.service";
11
13
  // ─── Rewards Controller ──────────────────────────────────────────────────────
@@ -131,6 +133,6 @@ export const RewardController = new Elysia({ prefix: "/rewards", detail: { tags:
131
133
  })
132
134
  .get("/total/distributed", async ({ query }) => await RewardService.getTotalDistributed(query.since.getTime() / 1000))
133
135
  .get("/total/distributed/by-opportunities", async ({ query }) => JSON.stringify(bigintToString(Array.from((await RewardService.getTotalDistributedByOpportunities(query.since.getTime() / 1000)).entries()))))
134
- .get("/total/distributed/by-chains", async ({ query }) => await RewardService.getTotalDistributedByChains(query.since.getTime() / 1000))
135
- .get("/total/distributed/by-types", async ({ query }) => await RewardService.getTotalDistributedByType(query.since.getTime() / 1000))
136
- .get("/total/distributed/by-protocols", async ({ query }) => await RewardService.getTotalDistributedByProtocol(query.since.getTime() / 1000));
136
+ .get("/total/distributed/by-chains", async ({ query }) => await CacheService.wrap(TTLPresets.DAY_1, RewardService.getTotalDistributedByChains, query.since.getTime() / 1000))
137
+ .get("/total/distributed/by-types", async ({ query }) => await CacheService.wrap(TTLPresets.DAY_1, RewardService.getTotalDistributedByType, query.since.getTime() / 1000))
138
+ .get("/total/distributed/by-protocols", async ({ query }) => await CacheService.wrap(TTLPresets.DAY_1, RewardService.getTotalDistributedByProtocol, query.since.getTime() / 1000));
@@ -1028,44 +1028,6 @@ export declare const v4: Elysia<"/v4", false, {
1028
1028
  };
1029
1029
  };
1030
1030
  };
1031
- } & {
1032
- opportunities: {
1033
- ":id": {
1034
- patch: {
1035
- body: {
1036
- name?: string | undefined;
1037
- status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
1038
- tags?: string[] | undefined;
1039
- };
1040
- params: {
1041
- id: string;
1042
- };
1043
- query: unknown;
1044
- headers: {
1045
- authorization: string;
1046
- };
1047
- response: {
1048
- 200: {
1049
- id: string;
1050
- name: string;
1051
- type: string;
1052
- status: import("@db/api").$Enums.Status;
1053
- tags: string[];
1054
- identifier: string;
1055
- action: import("@db/api").$Enums.OpportunityAction;
1056
- manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
1057
- chainId: number;
1058
- depositUrl: string | null;
1059
- explorerAddress: string | null;
1060
- mainProtocolId: string | null;
1061
- tvl: number;
1062
- apr: number;
1063
- dailyRewards: number;
1064
- };
1065
- };
1066
- };
1067
- };
1068
- };
1069
1031
  };
1070
1032
  } & {
1071
1033
  v4: {
@@ -297,8 +297,7 @@ export class TokenService {
297
297
  });
298
298
  }
299
299
  catch (err) {
300
- console.error("Failed to create price source.");
301
- console.error(err);
300
+ log.error("Failed to create price source.", err);
302
301
  }
303
302
  }
304
303
  return await TokenService.update(token.id, {